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

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

Issue 398343003: Use unified invalidation path for repaint-only style changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Also handle layers 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 4db5c5918070ac914af0f20b1068121555da0b79..e46ec13718e17d829f1b5ee3280ae45b40f3b357 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -2059,15 +2059,14 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
container->setNeedsOverflowRecalcAfterStyleChange();
}
- if (updatedDiff.needsRepaint()) {
- // 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 (updatedDiff.needsRepaintLayer()) {
+ toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
+ } else if (updatedDiff.needsRepaint()) {
+ // FIXME: For objects whose invalidateTreeIfNeeded won't invalidate themselves,
+ // we still need to invalidate now. crbug.com/394133.
+ if (needsLayout() || canSelfInvalidateDuringTreeInvalidation())
setShouldDoFullPaintInvalidation(true);
- else if (!selfNeedsLayout())
+ else
paintInvalidationForWholeRenderer();
}
}
@@ -2103,12 +2102,14 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
}
}
- // For style-only changes that need paint invalidation, we currently need to issue a paint invalidation before and after the style
- // change. The paint invalidation before style change is accomplished here. The paint invalidation after style change is accomplished
- // in RenderObject::setStyle.
if (m_parent && diff.needsRepaintObject()) {
- if (!diff.needsLayout() && !needsLayout())
- paintInvalidationForWholeRenderer();
+ if (!diff.needsLayout() && !needsLayout()) {
+ // Invalidate before style change.
+ // FIXME: See FIXMEs in setStyle() before calling paintInvalidationForWholeRenderer
+ // for the reason of this paintInvalidationForWholeRenderer.
+ if (!canSelfInvalidateDuringTreeInvalidation())
+ paintInvalidationForWholeRenderer();
+ }
}
if (isFloating() && (m_style->floating() != newStyle.floating()))
« 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