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

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

Issue 2039503002: Invalidate only non-scrolling layers for non-scrolling content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h ('k') | no next file » | 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 d36b46bdf321ddeb49160399dbc4ad3b18f0d130..7c0d267cf88c6e542bd3a0bbfc8330870a179005 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -1416,7 +1416,8 @@ enum ApplyToGraphicsLayersModeFlags {
ApplyToMaskLayers = (1 << 4),
ApplyToContentLayers = (1 << 5),
ApplyToChildContainingLayers = (1 << 6), // layers between m_graphicsLayer and children
- ApplyToScrollingContentLayers = (1 << 7),
+ ApplyToNonScrollingContentLayers = (1 << 7),
+ ApplyToScrollingContentLayers = (1 << 8),
ApplyToAllGraphicsLayers = (ApplyToSquashingLayer | ApplyToScrollbarLayers | ApplyToBackgroundLayer | ApplyToMaskLayers | ApplyToLayersAffectedByPreserve3D | ApplyToContentLayers | ApplyToScrollingContentLayers)
};
typedef unsigned ApplyToGraphicsLayersMode;
@@ -1428,7 +1429,7 @@ static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, const F
if ((mode & ApplyToLayersAffectedByPreserve3D) && mapping->childTransformLayer())
f(mapping->childTransformLayer());
- if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers)) && mapping->mainGraphicsLayer())
+ if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers) || (mode & ApplyToNonScrollingContentLayers)) && mapping->mainGraphicsLayer())
f(mapping->mainGraphicsLayer());
if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildContainingLayers)) && mapping->clippingLayer())
f(mapping->clippingLayer());
@@ -1445,12 +1446,12 @@ static void ApplyToGraphicsLayers(const CompositedLayerMapping* mapping, const F
if ((mode & ApplyToSquashingLayer) && mapping->squashingLayer())
f(mapping->squashingLayer());
- if (((mode & ApplyToMaskLayers) || (mode & ApplyToContentLayers)) && mapping->maskLayer())
+ if (((mode & ApplyToMaskLayers) || (mode & ApplyToContentLayers) || (mode & ApplyToNonScrollingContentLayers)) && mapping->maskLayer())
f(mapping->maskLayer());
- if (((mode & ApplyToMaskLayers) || (mode & ApplyToContentLayers)) && mapping->childClippingMaskLayer())
+ if (((mode & ApplyToMaskLayers) || (mode & ApplyToContentLayers) || (mode & ApplyToNonScrollingContentLayers)) && mapping->childClippingMaskLayer())
f(mapping->childClippingMaskLayer());
- if (((mode & ApplyToBackgroundLayer) || (mode & ApplyToContentLayers)) && mapping->backgroundLayer())
+ if (((mode & ApplyToBackgroundLayer) || (mode & ApplyToContentLayers) || (mode & ApplyToNonScrollingContentLayers)) && mapping->backgroundLayer())
f(mapping->backgroundLayer());
if ((mode & ApplyToScrollbarLayers) && mapping->layerForHorizontalScrollbar())
@@ -2096,9 +2097,9 @@ struct SetContentsNeedsDisplayInRectFunctor {
const DisplayItemClient& client;
};
-// r is in the coordinate space of the layer's layout object
void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason, const DisplayItemClient& client)
{
+ DCHECK(!m_owningLayer.layoutObject()->usesCompositedScrolling());
// TODO(wangxianzhu): Enable the following assert after paint invalidation for spv2 is ready.
// ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
@@ -2110,8 +2111,23 @@ void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P
ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
}
+void CompositedLayerMapping::setNonScrollingContentsNeedDisplayInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason, const DisplayItemClient& client)
+{
+ DCHECK(m_owningLayer.layoutObject()->usesCompositedScrolling());
+ // TODO(wangxianzhu): Enable the following assert after paint invalidation for spv2 is ready.
+ // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+
+ SetContentsNeedsDisplayInRectFunctor functor = {
+ enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
+ invalidationReason,
+ client
+ };
+ ApplyToGraphicsLayers(this, functor, ApplyToNonScrollingContentLayers);
+}
+
void CompositedLayerMapping::setScrollingContentsNeedDisplayInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason, const DisplayItemClient& client)
{
+ DCHECK(m_owningLayer.layoutObject()->usesCompositedScrolling());
// TODO(wangxianzhu): Enable the following assert after paint invalidation for spv2 is ready.
// ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698