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

Unified Diff: Source/core/rendering/RenderLayerModelObject.cpp

Issue 434453002: Promote inlines to first-class invalidation citizens (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: This is up to date... Created 6 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
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerModelObject.cpp
diff --git a/Source/core/rendering/RenderLayerModelObject.cpp b/Source/core/rendering/RenderLayerModelObject.cpp
index 6a776c5cdcb68b3d39f2604e2a516f03f6d3fab0..2e49acea7d3ef35cd33eee25c1b64418ab63469b 100644
--- a/Source/core/rendering/RenderLayerModelObject.cpp
+++ b/Source/core/rendering/RenderLayerModelObject.cpp
@@ -177,5 +177,41 @@ void RenderLayerModelObject::addLayerHitTestRects(LayerHitTestRects& rects, cons
}
}
+InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationContainer)
+{
+ const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
+ const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositionFromPaintInvalidationContainer();
+ setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInvalidationContainer, &paintInvalidationState));
+ setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromPaintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidationState));
+
+ // If we are set to do a full paint invalidation that means the RenderView will issue
+ // paint invalidations. We can then skip issuing of paint invalidations for the child
+ // renderers as they'll be covered by the RenderView.
+ if (view()->doingFullPaintInvalidation())
+ return InvalidationNone;
+
+ return RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState);
+}
+
+void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
+{
+ // FIXME: SVG should probably also go through this unified paint invalidation system.
+ ASSERT(!needsLayout());
+
+ if (!shouldCheckForPaintInvalidation(paintInvalidationState))
+ return;
+
+ bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer();
+ const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
+ ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
+
+ InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
+
+ PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
+ if (reason == InvalidationLocationChange || reason == InvalidationFull)
+ childTreeWalkState.setForceCheckForPaintInvalidation();
+ RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698