OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef PaintInvalidationReason_h | 5 #ifndef PaintInvalidationReason_h |
6 #define PaintInvalidationReason_h | 6 #define PaintInvalidationReason_h |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 enum PaintInvalidationReason { | 13 enum class PaintInvalidationReason : unsigned { |
14 kPaintInvalidationNone, | 14 kNone, |
15 kPaintInvalidationIncremental, | 15 kIncremental, |
16 kPaintInvalidationRectangle, | 16 kRectangle, |
17 // The following reasons will all cause full invalidation of the LayoutObject. | 17 // The following reasons will all cause full paint invalidation. |
18 kPaintInvalidationFull, // Any unspecified reason of full invalidation. | 18 kFull, // Any unspecified reason of full invalidation. |
19 kPaintInvalidationStyleChange, | 19 kStyle, |
20 kPaintInvalidationForcedByLayout, | 20 kGeometry, // Layout or visual geometry change. |
21 kPaintInvalidationCompositingUpdate, | 21 kCompositing, |
22 kPaintInvalidationBorderBoxChange, | 22 kAppeared, |
23 kPaintInvalidationContentBoxChange, | 23 kDisappeared, |
24 kPaintInvalidationLayoutOverflowBoxChange, | 24 kScroll, |
25 kPaintInvalidationBoundsChange, | 25 kScrollControl, // scroll bars, scroll corner, etc. |
26 kPaintInvalidationLocationChange, | 26 kSelection, |
27 kPaintInvalidationBackgroundObscurationChange, | 27 kOutline, |
28 kPaintInvalidationBecameVisible, | 28 kSubtree, |
29 kPaintInvalidationBecameInvisible, | 29 kSVGResource, |
30 kPaintInvalidationScroll, | 30 kBackground, |
31 kPaintInvalidationSelection, | 31 kBackgroundOnScrollingContentsLayer, |
32 kPaintInvalidationOutline, | 32 kCaret, |
33 kPaintInvalidationSubtree, | 33 kDocumentMarker, |
34 kPaintInvalidationLayoutObjectInsertion, | 34 kImage, |
35 kPaintInvalidationLayoutObjectRemoval, | 35 kForTesting, |
36 kPaintInvalidationSVGResourceChange, | 36 // kDelayedFull means that kFull is needed in order to fully paint the |
37 kPaintInvalidationBackgroundOnScrollingContentsLayer, | 37 // content, but that painting of the object can be delayed until a future |
38 kPaintInvalidationCaret, | 38 // frame. This can be the case for an object whose content is not visible to |
39 kPaintInvalidationViewBackground, | 39 // the user. |
40 kPaintInvalidationDocumentMarkerChange, | 40 kDelayedFull, |
41 kPaintInvalidationForTesting, | |
42 // PaintInvalidationDelayedFull means that PaintInvalidationFull is needed in | |
43 // order to fully paint the content, but that painting of the object can be | |
44 // delayed until a future frame. This can be the case for an object whose | |
45 // content is not visible to the user. | |
46 kPaintInvalidationDelayedFull, | |
47 | 41 |
48 kPaintInvalidationReasonMax = kPaintInvalidationDelayedFull | 42 kMax = kDelayedFull |
49 }; | 43 }; |
50 | 44 |
51 PLATFORM_EXPORT const char* PaintInvalidationReasonToString( | 45 PLATFORM_EXPORT const char* PaintInvalidationReasonToString( |
52 PaintInvalidationReason); | 46 PaintInvalidationReason); |
53 | 47 |
54 inline bool IsFullPaintInvalidationReason(PaintInvalidationReason reason) { | 48 inline bool IsFullPaintInvalidationReason(PaintInvalidationReason reason) { |
55 return reason >= kPaintInvalidationFull; | 49 return reason >= PaintInvalidationReason::kFull; |
56 } | 50 } |
57 | 51 |
58 inline bool IsImmediateFullPaintInvalidationReason( | 52 inline bool IsImmediateFullPaintInvalidationReason( |
59 PaintInvalidationReason reason) { | 53 PaintInvalidationReason reason) { |
60 return IsFullPaintInvalidationReason(reason) && | 54 return IsFullPaintInvalidationReason(reason) && |
61 reason != kPaintInvalidationDelayedFull; | 55 reason != PaintInvalidationReason::kDelayedFull; |
62 } | 56 } |
63 | 57 |
64 PLATFORM_EXPORT std::ostream& operator<<(std::ostream&, | 58 PLATFORM_EXPORT std::ostream& operator<<(std::ostream&, |
65 PaintInvalidationReason); | 59 PaintInvalidationReason); |
66 | 60 |
67 } // namespace blink | 61 } // namespace blink |
68 | 62 |
69 #endif // PaintInvalidationReason_h | 63 #endif // PaintInvalidationReason_h |
OLD | NEW |