| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/SVGModelObjectPaintInvalidator.h" | 5 #include "core/paint/SVGModelObjectPaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/layout/svg/LayoutSVGModelObject.h" | 7 #include "core/layout/svg/LayoutSVGModelObject.h" |
| 8 #include "core/paint/ObjectPaintInvalidator.h" | 8 #include "core/paint/ObjectPaintInvalidator.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 PaintInvalidationReason SVGModelObjectPaintInvalidator::invalidatePaintIfNeeded(
) | 12 PaintInvalidationReason SVGModelObjectPaintInvalidator::invalidatePaintIfNeeded(
) |
| 13 { | 13 { |
| 14 ObjectPaintInvalidatorWithContext objectPaintInvalidator(m_object, m_context
); | 14 ObjectPaintInvalidatorWithContext objectPaintInvalidator(m_object, m_context
); |
| 15 PaintInvalidationReason reason = objectPaintInvalidator.computePaintInvalida
tionReason(); | 15 PaintInvalidationReason reason = objectPaintInvalidator.computePaintInvalida
tionReason(); |
| 16 | 16 |
| 17 // Disable incremental invalidation for SVG objects to prevent under- | 17 // Disable incremental invalidation for SVG objects to prevent under- |
| 18 // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects | 18 // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects |
| 19 // to be able to be incrementally invalidated (e.g., on height changes). | 19 // to be able to be incrementally invalidated (e.g., on height changes). |
| 20 if (reason == PaintInvalidationIncremental && m_context.oldBounds != m_conte
xt.newBounds) | 20 if (reason == PaintInvalidationIncremental /*&& m_context.oldBounds != m_con
text.newBounds*/) |
| 21 reason = PaintInvalidationFull; | 21 reason = PaintInvalidationFull; |
| 22 | 22 |
| 23 return objectPaintInvalidator.invalidatePaintIfNeededWithComputedReason(reas
on); | 23 return objectPaintInvalidator.invalidatePaintIfNeededWithComputedReason(reas
on); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace blink | 26 } // namespace blink |
| OLD | NEW |