Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp

Issue 2143033005: Transfer components of SurfaceId in OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
index 7119ec0471da0fe9edd446d70cd1586f478b6534..2e1dddeb0c9e7b80ca6e7409c7b887233dd62dcd 100644
--- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
+++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
@@ -37,6 +37,13 @@ OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreenInternal(HTM
}
OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(canvas.width(), canvas.height());
offscreenCanvas->setAssociatedCanvasId(DOMNodeIds::idForNode(&canvas));
+
+ CanvasSurfaceLayerBridge* bridge = canvas.surfaceLayerBridge();
+ if (bridge) {
+ // If a bridge exists, it means canvas.createSurfaceLayer() has been called
+ // and its SurfaceId has been populated as well.
+ offscreenCanvas->setSurfaceId(bridge->getSurfaceId().client_id(), bridge->getSurfaceId().local_id(), bridge->getSurfaceId().nonce());
+ }
return offscreenCanvas;
}
« no previous file with comments | « third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698