| 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..28bf2c7f1ae06cc0c20020af792e306e7de77b2b 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 isCanvasControlledByOffscreen(const LayoutObject* layoutObject)
|
| +{
|
| + if (layoutObject->isCanvas()) {
|
| + HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node());
|
| + if (canvas->surfaceLayerBridge())
|
| + 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 (isCanvasControlledByOffscreen(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())
|
|
|