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

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

Issue 2489893002: [SPv2] Track paint offset change (Closed)
Patch Set: - Created 4 years, 1 month 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 f9630d3fc0d8b758ddf05e3f662804a7238f168b..de09075bf226e034ba1b6361e1cb5016bd325742 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -529,19 +529,27 @@ ObjectPaintInvalidatorWithContext::invalidatePaintIfNeededWithComputedReason(
switch (reason) {
case PaintInvalidationNone:
- // 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 invalidation is issued.
- // See crbug.com/508383 and crbug.com/515977. This is a workaround to
- // force display items to update paint offset. Exclude non-root SVG whose
- // paint offset is always zero.
- if ((!m_object.isSVG() || m_object.isSVGRoot()) &&
- (m_context.forcedSubtreeInvalidationFlags &
- PaintInvalidatorContext::ForcedSubtreeInvalidationChecking)) {
- reason = PaintInvalidationLocationChange;
- break;
+ // 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 invalidation is issued. See
+ // crbug.com/508383 and crbug.com/515977.
+ if (m_context.forcedSubtreeInvalidationFlags &
+ PaintInvalidatorContext::ForcedSubtreeInvalidationChecking) {
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ if (m_context.oldPaintOffset != m_context.newPaintOffset) {
+ reason = PaintInvalidationLocationChange;
+ break;
+ }
+ } else {
+ // For SPv1, we conservatively assume the object changed paint offset
+ // except for non-root SVG whose paint offset is always zero.
+ if (!m_object.isSVG() || m_object.isSVGRoot()) {
+ reason = PaintInvalidationLocationChange;
+ break;
+ }
+ }
}
+
if (m_object.isSVG() &&
(m_context.forcedSubtreeInvalidationFlags &
PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) {
« no previous file with comments | « third_party/WebKit/Source/core/paint/InlinePainter.cpp ('k') | third_party/WebKit/Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698