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

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

Issue 2247543003: Tweak priorities of paint invalidation reasons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NeedsRebaseline (for win and mac) Created 4 years, 4 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 9b3e8de3fda26c2bb1947877dc405341a5772b82..a60990f0d0c0e3428339cfcbc39db469013f5106 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -86,10 +86,13 @@ PaintInvalidationReason ObjectPaintInvalidator::computePaintInvalidationReason()
if (m_object.shouldDoFullPaintInvalidation())
return m_object.fullPaintInvalidationReason();
+ if (m_context.oldBounds.isEmpty() && m_context.newBounds.isEmpty())
+ return PaintInvalidationNone;
+
if (backgroundObscurationChanged)
return PaintInvalidationBackgroundObscurationChange;
- if (m_object.paintedOutputOfObjectHasNoEffect())
+ if (m_object.paintedOutputOfObjectHasNoEffectRegardlessOfSize())
return PaintInvalidationNone;
const ComputedStyle& style = m_object.styleRef();
@@ -106,12 +109,7 @@ PaintInvalidationReason ObjectPaintInvalidator::computePaintInvalidationReason()
// If the bounds are the same then we know that none of the statements below
// can match, so we can early out.
if (m_context.oldBounds == m_context.newBounds)
- return locationChanged && !m_context.oldBounds.isEmpty() ? PaintInvalidationLocationChange : PaintInvalidationNone;
-
- // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
- // be caused by some layout property (left / top) or some in-flow layoutObject inserted / removed before us in the tree.
- if (m_context.newBounds.location() != m_context.oldBounds.location())
- return PaintInvalidationBoundsChange;
+ return locationChanged ? PaintInvalidationLocationChange : PaintInvalidationProbablyNone;
// 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.
@@ -120,6 +118,11 @@ PaintInvalidationReason ObjectPaintInvalidator::computePaintInvalidationReason()
if (m_context.newBounds.isEmpty())
return PaintInvalidationBecameInvisible;
+ // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
+ // be caused by some layout property (left / top) or some in-flow layoutObject inserted / removed before us in the tree.
+ if (m_context.newBounds.location() != m_context.oldBounds.location())
+ return PaintInvalidationBoundsChange;
+
if (locationChanged)
return PaintInvalidationLocationChange;
@@ -131,7 +134,7 @@ void ObjectPaintInvalidator::invalidateSelectionIfNeeded(PaintInvalidationReason
// Update selection rect when we are doing full invalidation (in case that the object is moved,
// composite status changed, etc.) or shouldInvalidationSelection is set (in case that the
// selection itself changed).
- bool fullInvalidation = isFullPaintInvalidationReason(reason);
+ bool fullInvalidation = isImmediateFullPaintInvalidationReason(reason);
if (!fullInvalidation && !m_object.shouldInvalidateSelection())
return;
@@ -159,6 +162,7 @@ PaintInvalidationReason ObjectPaintInvalidator::invalidatePaintIfNeededWithCompu
switch (reason) {
case PaintInvalidationNone:
+ case PaintInvalidationProbablyNone:
// TODO(trchen): Currently we don't keep track of paint offset of layout objects.
// There are corner cases that the display items need to be invalidated for paint offset
// mutation, but incurs no pixel difference (i.e. bounds stay the same) so no rect-based
@@ -175,7 +179,7 @@ PaintInvalidationReason ObjectPaintInvalidator::invalidatePaintIfNeededWithCompu
case PaintInvalidationDelayedFull:
return PaintInvalidationDelayedFull;
default:
- DCHECK(isFullPaintInvalidationReason(reason));
+ DCHECK(isImmediateFullPaintInvalidationReason(reason));
fullyInvalidatePaint(reason, m_context.oldBounds, m_context.newBounds);
}

Powered by Google App Engine
This is Rietveld 408576698