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

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

Issue 398343003: Use unified invalidation path for repaint-only style changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update naming Created 6 years, 5 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: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index b7fd24d02e0217a579e07bedc5a1acd8192c9bc2..e3824453e811c3c82cf573c92e97173572fb281c 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1554,7 +1554,7 @@ void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
// FIXME: SVG should probably also go through this unified paint invalidation system.
ASSERT(!needsLayout());
- if (!shouldCheckForPaintInvalidation())
+ if (!shouldCheckForSelfOrChildPaintInvalidation())
return;
bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer();
@@ -1562,6 +1562,20 @@ void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
// FIXME: This assert should be re-enabled when we move paint invalidation to after compositing update. crbug.com/360286
// ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
+ invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
+
+ // This is for the next invalidatePaintIfNeeded so must be after invalidatePaintIfNeeded().
+ savePreviousBorderBoxSizeIfNeeded();
+
+ PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
+ RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
+}
+
+void RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationContainer)
+{
+ if (!shouldCheckForPaintInvalidation())
+ return;
+
const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositionFromPaintInvalidationContainer();
setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInvalidationContainer, &paintInvalidationState));
@@ -1570,13 +1584,8 @@ void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
// 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()->doingFullRepaint()) {
- PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
- RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
- // For the next invalidatePaintIfNeeded.
- savePreviousBorderBoxSizeIfNeeded();
+ if (view()->doingFullRepaint())
return;
- }
if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsIntoOwnBacking)
|| (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
@@ -1585,12 +1594,9 @@ void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
setShouldDoFullPaintInvalidation(true);
}
- if (!invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState))
+ if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState))
invalidatePaintForOverflowIfNeeded();
- // This is for the next invalidatePaintIfNeeded so must be after invalidatePaintIfNeeded.
- savePreviousBorderBoxSizeIfNeeded();
-
// Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer.
if (enclosingLayer()) {
if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea()) {
@@ -1601,9 +1607,6 @@ void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
area->resetScrollbarDamage();
}
}
-
- PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
- RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
}
bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumulatedOffset, ContentsClipBehavior contentsClipBehavior)

Powered by Google App Engine
This is Rietveld 408576698