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 PaintInvalidationReason reason = ObjectPaintInvalidator(m_object, m_context)
.computePaintInvalidationReason(); | 14 PaintInvalidationReason reason = ObjectPaintInvalidator(m_object, m_context)
.computePaintInvalidationReason(); |
15 | 15 |
16 // Disable incremental invalidation for SVG objects to prevent under- | 16 // Disable incremental invalidation for SVG objects to prevent under- |
17 // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects | 17 // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects |
18 // to be able to be incrementally invalidated (e.g., on height changes). | 18 // to be able to be incrementally invalidated (e.g., on height changes). |
19 if (reason == PaintInvalidationIncremental) | 19 if (reason == PaintInvalidationIncremental && m_context.oldBounds != m_conte
xt.newBounds) |
20 reason = PaintInvalidationFull; | 20 reason = PaintInvalidationFull; |
21 | 21 |
22 return ObjectPaintInvalidator(m_object, m_context).invalidatePaintIfNeededWi
thComputedReason(reason); | 22 return ObjectPaintInvalidator(m_object, m_context).invalidatePaintIfNeededWi
thComputedReason(reason); |
23 } | 23 } |
24 | 24 |
25 } // namespace blink | 25 } // namespace blink |
OLD | NEW |