Chromium Code Reviews| 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 a67d5daa6b6ed92a786f29761a9469fa43a62f88..7e8313263f100fd842ed9ea4014e7d6c941d8a10 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -119,6 +119,14 @@ static inline bool isAcceleratedCanvas(const LayoutObject& layoutObject) { |
| return false; |
| } |
| +static inline bool isPlaceholderCanvas(const LayoutObject& layoutObject) { |
|
xlai (Olivia)
2017/03/24 20:24:59
You don't need to add this function. There is "isC
|
| + if (layoutObject.isCanvas()) { |
| + HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject.node()); |
| + return canvas->surfaceLayerBridge(); |
| + } |
| + return false; |
| +} |
| + |
| static inline bool isCanvasControlledByOffscreen( |
| const LayoutObject& layoutObject) { |
| if (layoutObject.isCanvas()) { |
| @@ -427,6 +435,10 @@ void CompositedLayerMapping::updateContentsOpaque() { |
| m_graphicsLayer->setContentsOpaque(false); |
| m_backgroundLayer->setContentsOpaque( |
| m_owningLayer.backgroundIsKnownToBeOpaqueInRect(compositedBounds())); |
| + } else if (isPlaceholderCanvas(layoutObject())) { |
| + // TODO(crbug.com/705019): Contents could be opaque, but that cannot be |
| + // determined from the main thread. Or can it? |
| + m_graphicsLayer->setContentsOpaque(false); |
| } else { |
| // For non-root layers, background is painted by the scrolling contents |
| // layer if all backgrounds are background attachment local, otherwise |