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

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

Issue 2774903003: Fix the compositing of placeholder canvas backgrounds (Closed)
Patch Set: fix comments Created 3 years, 9 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 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

Powered by Google App Engine
This is Rietveld 408576698