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

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

Issue 2082153002: Paint solid color and local attachment backgrounds into scrolling layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert some changes 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c0818175026a76d87c86744541c6ad4b8ad425d8..e80a003d02f94cb49fb7d58cc62fac133a86ee97 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -309,8 +309,16 @@ void CompositedLayerMapping::updateContentsOpaque()
m_graphicsLayer->setContentsOpaque(false);
m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOpaqueInRect(compositedBounds()));
} else {
- // For non-root layers, background is always painted by the primary graphics layer.
- m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOpaqueInRect(compositedBounds()));
+ const bool backgroundOpaque = m_owningLayer.backgroundIsKnownToBeOpaqueInRect(compositedBounds());
+ // Whether or not the background is painted into the primary graphics layer, it will be
+ // entirely occluded by an opaque background.
+ m_graphicsLayer->setContentsOpaque(backgroundOpaque);
+
+ // For non-root layers, background is painted by the scrolling contents layer if all backgrounds
+ // are solid color or background attachment local, otherwise background is painted by
+ // the primary graphics layer.
+ if (hasScrollingLayer() && m_owningLayer.shouldPaintBackgroundOntoForeground())
+ m_scrollingContentsLayer->setContentsOpaque(backgroundOpaque);
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698