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

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: Update previousPaintInvalidationRect 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 | « LayoutTests/svg/repaint/repaint-paintorder-expected.txt ('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..8487a99918a0bfddcba3de23d49cbdb99b4a645a 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);
+
+ // We should invalidate previousPaintInvalidationRect, but for objects that don't save previousPaintInvalidationRect,
+ // we have to use the current paint invalidation rect.
+ LayoutRect paintInvalidationRect = isBox() || isSVG() ? previousPaintInvalidationRect() : boundsRectForPaintInvalidation(paintInvalidationContainer);
leviw_travelin_and_unemployed 2014/07/15 23:41:29 This will still be broken for inlines and such, no
Xianzhu 2014/07/16 00:22:36 Add FIXME with link to crbug.com/394133.
invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationRect, InvalidationPaint);
}
@@ -2059,12 +2062,32 @@ 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())
- paintInvalidationForWholeRenderer();
+ } else {
+ // The paintInvalidationForWholeRenderer() calls are needed for non-layout changes to style. See the corresponding
+ // comment in RenderObject::styleWillChange for why.
+
+ bool shouldInvalidatePaint;
+ if (isBox() || isSVG()) {
+ // Should do paint invalidation if the original diff didn't require repaint.
+ if (!diff.needsRepaint())
leviw_travelin_and_unemployed 2014/07/15 23:41:29 It feels to me like this optimization and the fix
Xianzhu 2014/07/16 00:22:36 Done.
+ shouldInvalidatePaint = true;
+ LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(containerForPaintInvalidation());
+ if (paintInvalidationRect != previousPaintInvalidationRect()) {
+ shouldInvalidatePaint = true;
+ // If the original diff didn't require require repaint, invalidate the previous paint rect.
+ if (!diff.needsRepaint())
+ paintInvalidationForWholeRenderer();
+ setPreviousPaintInvalidationRect(paintInvalidationRect);
+ }
+ } else {
+ shouldInvalidatePaint = true;
+ }
+
+ if (shouldInvalidatePaint)
+ paintInvalidationForWholeRenderer();
+ }
}
}
« no previous file with comments | « LayoutTests/svg/repaint/repaint-paintorder-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698