Chromium Code Reviews| 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. |
|
chrishtr
2016/11/10 18:42:00
SPv2 fixes the issue of paint offset always being
Xianzhu
2016/11/10 22:51:50
The paint offsets are always 0 intentionally. For
|
| + if (!m_object.isSVG() || m_object.isSVGRoot()) { |
| + reason = PaintInvalidationLocationChange; |
| + break; |
| + } |
| + } |
| } |
| + |
| if (m_object.isSVG() && |
| (m_context.forcedSubtreeInvalidationFlags & |
| PaintInvalidatorContext::ForcedSubtreeSVGResourceChange)) { |