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 |