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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2259493004: Fix Compositing of Opaque Scrolling Layers and Add Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New tests. Created 4 years, 4 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/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 9fa0a8e32d6fdd95aeccbb84c1e4ee9423d139bb..bd6279a3ae29c8ff13295bb007c0ac061db95100 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -2334,6 +2334,14 @@ GraphicsLayer* PaintLayer::graphicsLayerBackingForScrolling() const
}
}
+bool PaintLayer::shouldPaintBackgroundOntoScrollingContentsLayer() const
+{
+ return !isRootLayer()
+ && scrollsOverflow()
+ && layoutObject()->style()->hasEntirelyLocalBackground()
+ && !stackingNode()->hasNegativeZOrderList();
+}
+
void PaintLayer::ensureCompositedLayerMapping()
{
if (m_rareData && m_rareData->compositedLayerMapping)
@@ -2397,9 +2405,6 @@ bool PaintLayer::paintsWithTransform(GlobalPaintFlags globalPaintFlags) const
bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const
{
- if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant())
- return false;
Stephen Chennney 2016/08/29 20:49:52 This check is redundant in all pre-existing caller
-
if (paintsWithTransparency(GlobalPaintNormalPhase))
return false;
@@ -2421,8 +2426,6 @@ bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
if (m_stackingNode->zOrderListsDirty())
return false;
- // FIXME: We currently only check the immediate layoutObject,
- // which will miss many cases.
if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect))
return true;
@@ -2431,13 +2434,17 @@ bool PaintLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
if (layoutObject()->hasClipRelatedProperty())
return false;
+ // TODO(schenney): This could be improved by unioning the opaque regions of all the children.
+ // That would require a refactoring because currently children just check they at least
+ // cover the given rect, but a unioning method would require children to compute and report
+ // their rects.
return childBackgroundIsKnownToBeOpaqueInRect(localRect);
}
bool PaintLayer::childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const
{
- PaintLayerStackingNodeReverseIterator revertseIterator(*m_stackingNode, PositiveZOrderChildren | NormalFlowChildren | NegativeZOrderChildren);
- while (PaintLayerStackingNode* child = revertseIterator.next()) {
+ PaintLayerStackingNodeReverseIterator reverseIterator(*m_stackingNode, PositiveZOrderChildren | NormalFlowChildren | NegativeZOrderChildren);
+ while (PaintLayerStackingNode* child = reverseIterator.next()) {
const PaintLayer* childLayer = child->layer();
// Stop at composited paint boundaries.
if (childLayer->isPaintInvalidationContainer())
Stephen Chennney 2016/08/29 20:49:52 I think this means we do not need to check that th
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698