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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1999143002: Add CanvasSurfaceLayerBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 57eeda916ab7246c8b4a67294ae3ca4249041205..eefb88370c1e808f4b07c4a53b20fb7db212ac42 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -123,6 +123,16 @@ static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject)
return false;
}
+static inline bool isCanvasTransferedFromOffscreen(const LayoutObject* layoutObject)
Justin Novosad 2016/05/20 19:58:26 isCanvasControlledByOffscreen
+{
+ if (layoutObject->isCanvas()) {
+ HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
+ if (!!canvas->surfaceLayerBridge())
Justin Novosad 2016/05/20 19:58:26 "!!" is not necessary
+ return true;
+ }
+ return false;
+}
+
static bool hasBoxDecorationsOrBackgroundImage(const ComputedStyle& style)
{
return style.hasBoxDecorations() || style.hasBackgroundImage();
@@ -538,6 +548,10 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
} else if (layoutObject->isVideo()) {
HTMLMediaElement* mediaElement = toHTMLMediaElement(layoutObject->node());
m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer());
+ } else if (isCanvasTransferedFromOffscreen(layoutObject)) {
+ HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
+ m_graphicsLayer->setContentsToPlatformLayer(canvas->surfaceLayerBridge()->getWebLayer());
+ layerConfigChanged = true;
} else if (isAcceleratedCanvas(layoutObject)) {
HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
if (CanvasRenderingContext* context = canvas->renderingContext())

Powered by Google App Engine
This is Rietveld 408576698