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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1403963002: Invalidate non-self-painting-layer descendants when creating a layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add spv2 expectation for the test Created 5 years, 2 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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 2499b0365de08b2b19824780c8af16bcf705f6f5..f4b615a98126bd464e28e838a099c7a38c4dd609 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -3388,6 +3388,18 @@ void LayoutObject::invalidateDisplayItemClientForNonCompositingDescendantsOf(con
traverseNonCompositingDescendants(const_cast<LayoutObject&>(object), Functor(paintInvalidationContainer));
}
+void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason reason) const
+{
+ // These disablers are valid because we want to use the current compositing/invalidation status.
+ DisablePaintInvalidationStateAsserts invalidationDisabler;
+ DisableCompositingQueryAsserts compositingDisabler;
+
+ LayoutRect invalidationRect = previousPaintInvalidationRect();
+ adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalidationContainer);
+ invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, PaintInvalidationLayer);
+ invalidateDisplayItemClients(paintInvalidationContainer, PaintInvalidationLayer, invalidationRect, invalidationRect);
+}
+
void LayoutObject::invalidatePaintIncludingNonCompositingDescendants()
{
class Functor : public LayoutObjectTraversalFunctor {
@@ -3395,10 +3407,7 @@ void LayoutObject::invalidatePaintIncludingNonCompositingDescendants()
explicit Functor(const LayoutBoxModelObject& paintInvalidationContainer) : m_paintInvalidationContainer(paintInvalidationContainer) { }
void operator()(LayoutObject& object) const override
{
- LayoutRect invalidationRect = object.previousPaintInvalidationRect();
- object.adjustInvalidationRectForCompositedScrolling(invalidationRect, m_paintInvalidationContainer);
- object.invalidatePaintUsingContainer(m_paintInvalidationContainer, invalidationRect, PaintInvalidationLayer);
- object.invalidateDisplayItemClients(m_paintInvalidationContainer, PaintInvalidationLayer, invalidationRect, invalidationRect);
+ object.invalidatePaintOfPreviousPaintInvalidationRect(m_paintInvalidationContainer, PaintInvalidationLayer);
}
private:
const LayoutBoxModelObject& m_paintInvalidationContainer;
@@ -3425,6 +3434,15 @@ void LayoutObject::setShouldDoFullPaintInvalidationIncludingNonCompositingDescen
traverseNonCompositingDescendants(*this, Functor());
}
+void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer)
+{
+ invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationContainer, PaintInvalidationLayer);
+ for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibling()) {
+ if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSelfPaintingLayer())
+ child->invalidatePaintIncludingNonSelfPaintingLayerDescendants(paintInvalidationContainer);
+ }
+}
+
void LayoutObject::setIsSlowRepaintObject(bool isSlowRepaintObject)
{
ASSERT(frameView());
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutObjectChildList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698