mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 524180 - fire an event when async canvas draws finish. r=olli
This commit is contained in:
parent
d4c42c1218
commit
4a4ac6eb22
@ -1125,6 +1125,18 @@ nsCanvasRenderingContext2D::Swap(mozilla::ipc::Shmem& aBack,
|
||||
memcpy(mBackBuffer.get<unsigned char>(), mFrontBuffer.get<unsigned char>(),
|
||||
mWidth * mHeight * 4);
|
||||
|
||||
// Notify listeners that we've finished drawing
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(mCanvasElement);
|
||||
nsIDocument* ownerDoc = nsnull;
|
||||
if (content)
|
||||
ownerDoc = content->GetOwnerDoc();
|
||||
|
||||
if (ownerDoc && mCanvasElement) {
|
||||
nsContentUtils::DispatchTrustedEvent(ownerDoc, mCanvasElement,
|
||||
NS_LITERAL_STRING("MozAsyncCanvasRender"),
|
||||
/* aCanBubble = */ PR_TRUE,
|
||||
/* aCancelable = */ PR_TRUE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user