mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 655836: Use Snapshot API for drawing one Azure canvas to another. r=roc
This commit is contained in:
parent
fdd511ec35
commit
37e7838c7d
@ -3682,6 +3682,27 @@ nsCanvasRenderingContext2DAzure::DrawImage(nsIDOMElement *imgElt, float a1,
|
||||
imgSize = gfxIntSize(mWidth, mHeight);
|
||||
}
|
||||
|
||||
// Special case for Canvas, which could be an Azure canvas!
|
||||
if (canvas) {
|
||||
if (canvas->CountContexts() == 1) {
|
||||
nsICanvasRenderingContextInternal *srcCanvas = canvas->GetContextAtIndex(0);
|
||||
|
||||
// This might not be an Azure canvas!
|
||||
if (srcCanvas) {
|
||||
srcSurf = srcCanvas->GetSurfaceSnapshot();
|
||||
|
||||
if (srcSurf && mCanvasElement) {
|
||||
// Do security check here.
|
||||
CanvasUtils::DoDrawImageSecurityCheck(HTMLCanvasElement(),
|
||||
content->NodePrincipal(), canvas->IsWriteOnly(),
|
||||
false);
|
||||
|
||||
imgSize = gfxIntSize(srcSurf->GetSize().width, srcSurf->GetSize().height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!srcSurf) {
|
||||
// The canvas spec says that drawImage should draw the first frame
|
||||
// of animated images
|
||||
|
Loading…
Reference in New Issue
Block a user