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

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

Issue 395463003: Invalidate previous paint rect in RenderObject::paintInvalidationForWholeRenderer() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add savesPreviousPaintInvalidationRect; Remove extra optimization code 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
« no previous file with comments | « Source/core/rendering/RenderObject.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/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 612025741947dfc4a0327918231b98b6bb27393f..fbd8f6add1395d999a446f1f5ee2a88a69dc3a29 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1531,7 +1531,10 @@ void RenderObject::paintInvalidationForWholeRenderer() const
// Until those states are fully fledged, I'll just disable the ASSERTS.
DisableCompositingQueryAsserts disabler;
const RenderLayerModelObject* paintInvalidationContainer = containerForPaintInvalidation();
- LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInvalidationContainer);
+
+ // FIXME: We should invalidate previousPaintInvalidationRect, but for objects that don't save previousPaintInvalidationRect,
+ // we have to use the current paint invalidation rect. crbug.com/394133.
+ LayoutRect paintInvalidationRect = savesPreviousPaintInvalidationRect() ? previousPaintInvalidationRect() : boundsRectForPaintInvalidation(paintInvalidationContainer);
invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationRect, InvalidationPaint);
}
@@ -2059,12 +2062,23 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
// Invalidate paints with the new style, e.g., for example if we go from not having
// an outline to having an outline.
- // The paintInvalidationForWholeRenderer() call is needed for non-layout changes to style. See the corresponding
- // comment in RenderObject::styleWillChange for why.
- if (needsLayout())
+ if (needsLayout()) {
setShouldDoFullPaintInvalidationAfterLayout(true);
- else if (!selfNeedsLayout())
+ } else {
+ // The paintInvalidationForWholeRenderer() calls are needed for non-layout changes to style. See the corresponding
+ // comment in RenderObject::styleWillChange for why.
+ if (savesPreviousPaintInvalidationRect()) {
+ LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(containerForPaintInvalidation());
+ if (paintInvalidationRect != previousPaintInvalidationRect()) {
+ // If the original diff didn't require repaint, invalidate previousPaintInvalidationRect
+ // before we save a new previousPaintInvalidationRect.
+ if (!diff.needsRepaint())
chrishtr 2014/07/16 00:49:22 Why the !diff.needsRepaint() conditional? Why don
Xianzhu 2014/07/16 01:59:49 '!diff.needsRepaint() && updatedDiff.needsRepaint(
+ paintInvalidationForWholeRenderer();
+ setPreviousPaintInvalidationRect(paintInvalidationRect);
+ }
+ }
paintInvalidationForWholeRenderer();
+ }
}
}
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698