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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2669003002: Optimize outline paint invalidation (Closed)
Patch Set: - Created 3 years, 11 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: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
index b566d57efae8cf1c6442700c188c39af9662c424..34a4ed57083e1dd4aaaeed8634ff9b3f2f313c24 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -488,14 +488,14 @@ ObjectPaintInvalidatorWithContext::computePaintInvalidationReason() {
if (m_object.paintedOutputOfObjectHasNoEffectRegardlessOfSize())
return PaintInvalidationNone;
- const ComputedStyle& style = m_object.styleRef();
-
- // The outline may change shape because of position change of descendants. For
- // simplicity, just force full paint invalidation if this object is marked for
- // checking paint invalidation for any reason.
- // TODO(wangxianzhu): Optimize this.
- if (style.hasOutline())
+ // Force full paint invalidation if the outline may be affected by descendants
+ // and this object is marked for checking paint invalidation for any reason.
+ if (m_object.outlineMayBeAffectedByDescendants() ||
+ m_object.previousOutlineMayBeAffectedByDescendants()) {
+ m_object.getMutableForPainting()
+ .updatePreviousOutlineMayBeAffectedByDescendants();
return PaintInvalidationOutline;
+ }
// If the size is zero on one of our bounds then we know we're going to have
// to do a full invalidation of either old bounds or new bounds.

Powered by Google App Engine
This is Rietveld 408576698