OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/paint/SVGModelObjectPaintInvalidator.h" | |
6 | |
7 #include "core/layout/svg/LayoutSVGModelObject.h" | |
8 #include "core/paint/ObjectPaintInvalidator.h" | |
9 | |
10 namespace blink { | |
11 | |
12 PaintInvalidationReason | |
13 SVGModelObjectPaintInvalidator::invalidatePaintIfNeeded() { | |
14 ObjectPaintInvalidatorWithContext objectPaintInvalidator(m_object, m_context); | |
15 PaintInvalidationReason reason = | |
16 objectPaintInvalidator.computePaintInvalidationReason(); | |
17 | |
18 // Disable incremental invalidation for SVG objects to prevent under- | |
19 // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects | |
20 // to be able to be incrementally invalidated (e.g., on height changes). | |
21 if (reason == PaintInvalidationIncremental && | |
22 m_context.oldBounds != m_context.newBounds) | |
23 reason = PaintInvalidationFull; | |
24 | |
25 return objectPaintInvalidator.invalidatePaintIfNeededWithComputedReason( | |
26 reason); | |
27 } | |
28 | |
29 } // namespace blink | |
OLD | NEW |