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

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

Issue 2449953005: [SPInvalidation] Handle pixel-snapping of paint invalidation rects (Closed)
Patch Set: Created 4 years, 2 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/BoxPaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
index f813347b85cce652662f1f1a2eaadc35f60fc2a0..14a155c34efc0fb52ab3b22bad9d1ad8b9137e71 100644
--- a/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.cpp
@@ -157,17 +157,27 @@ PaintInvalidationReason BoxPaintInvalidator::computePaintInvalidationReason() {
return reason;
}
- // If the transform is not identity or translation, incremental invalidation
- // is not applicable because the difference between oldBounds and newBounds
- // doesn't cover all area needing invalidation.
- // FIXME: Should also consider ancestor transforms since
- // paintInvalidationContainer. crbug.com/426111.
if (reason == PaintInvalidationIncremental &&
- m_context.oldBounds != m_context.newBounds &&
- m_context.paintInvalidationContainer != m_box && m_box.hasLayer() &&
- m_box.layer()->transform() &&
- !m_box.layer()->transform()->isIdentityOrTranslation())
- return PaintInvalidationBoundsChange;
+ m_context.oldBounds != m_context.newBounds) {
+ if (m_context.newBoundsCoversExtraPixels ||
+ m_context.oldBoundsCoversExtraPixels) {
+ // Incremental invalidation is not applicable because the difference
+ // between oldBounds and newBounds may not cover all changed pixels along
+ // the edges.
+ return PaintInvalidationBoundsChange;
+ }
+
+ // If the transform is not identity or translation, incremental invalidation
+ // is not applicable because the difference between oldBounds and newBounds
+ // doesn't cover all area needing invalidation.
+ // TODO(crbug.com/426111): Should also consider ancestor transforms
+ // since paintInvalidationContainer. Combine this logic into the above
+ // boundsCoversExtraPixels logic.
+ if (m_context.paintInvalidationContainer != m_box && m_box.hasLayer() &&
+ m_box.layer()->transform() &&
+ !m_box.layer()->transform()->isIdentityOrTranslation())
+ return PaintInvalidationBoundsChange;
+ }
const ComputedStyle& style = m_box.styleRef();
if (style.backgroundLayers().thisOrNextLayersUseContentBox() ||

Powered by Google App Engine
This is Rietveld 408576698