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

Unified Diff: Source/core/rendering/RenderBox.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/RenderBox.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 339f442bc6927e5fc23c79b7a071c0be952a0631..7ecb834abe10267e8579af6d7206644bb71f34d3 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1543,34 +1543,6 @@ bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer
return false;
}
-void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
-{
- // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally, RenderBlockFlows with
- // inline children should track a dirty rect in local coordinates for dirty lines instead of invalidating
- // the world.
- // FIXME: We should still be recursing through inline's children, as they can have boxes, but we don't
- // appear to have tests for this?
- // 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);
-
- // This is for the next invalidatePaintIfNeeded so must be after invalidatePaintIfNeeded.
- savePreviousBorderBoxSizeIfNeeded();
-
- PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
- if (reason == InvalidationLocationChange || reason == InvalidationFull)
- childTreeWalkState.setForceCheckForPaintInvalidation();
- RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
-}
-
InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationContainer)
{
const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
@@ -1578,30 +1550,34 @@ InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta
setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInvalidationContainer, &paintInvalidationState));
setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromPaintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidationState));
+ InvalidationReason reason = InvalidationNone;
+
// If we are set to do a full paint invalidation that means the RenderView will be
// 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;
-
- if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsIntoOwnBacking)
- || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
- && hasLayer()
- && layer()->isSelfPaintingLayer())) {
- setShouldDoFullPaintInvalidation(true, MarkOnlyThis);
- }
+ if (!view()->doingFullPaintInvalidation()) {
+ if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsIntoOwnBacking)
+ || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
+ && hasLayer()
+ && layer()->isSelfPaintingLayer())) {
+ setShouldDoFullPaintInvalidation(true, MarkOnlyThis);
+ }
- InvalidationReason reason = RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState);
- if (reason == InvalidationNone || reason == InvalidationIncremental)
- invalidatePaintForOverflowIfNeeded();
+ reason = RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState);
+ if (reason == InvalidationNone || reason == InvalidationIncremental)
+ invalidatePaintForOverflowIfNeeded();
- // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer.
- if (ScrollableArea* area = scrollableArea()) {
- if (area->hasVerticalBarDamage())
- invalidatePaintRectangle(area->verticalBarDamage());
- if (area->hasHorizontalBarDamage())
- invalidatePaintRectangle(area->horizontalBarDamage());
+ // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer.
+ if (ScrollableArea* area = scrollableArea()) {
+ if (area->hasVerticalBarDamage())
+ invalidatePaintRectangle(area->verticalBarDamage());
+ if (area->hasHorizontalBarDamage())
+ invalidatePaintRectangle(area->horizontalBarDamage());
+ }
}
+
+ // This is for the next invalidatePaintIfNeeded so must be at the end.
+ savePreviousBorderBoxSizeIfNeeded();
return reason;
}
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698