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 #include "platform/graphics/PaintInvalidationReason.h" | 5 #include "platform/graphics/PaintInvalidationReason.h" |
6 | 6 |
7 #include "platform/wtf/Assertions.h" | 7 #include "platform/wtf/Assertions.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 const char* PaintInvalidationReasonToString(PaintInvalidationReason reason) { | 11 const char* PaintInvalidationReasonToString(PaintInvalidationReason reason) { |
12 switch (reason) { | 12 switch (reason) { |
13 case kPaintInvalidationNone: | 13 case PaintInvalidationReason::kNone: |
14 return "none"; | 14 return "none"; |
15 case kPaintInvalidationIncremental: | 15 case PaintInvalidationReason::kIncremental: |
16 return "incremental"; | 16 return "incremental"; |
17 case kPaintInvalidationRectangle: | 17 case PaintInvalidationReason::kRectangle: |
18 return "invalidate paint rectangle"; | 18 return "invalidate paint rectangle"; |
19 case kPaintInvalidationFull: | 19 case PaintInvalidationReason::kFull: |
20 return "full"; | 20 return "full"; |
21 case kPaintInvalidationStyleChange: | 21 case PaintInvalidationReason::kStyle: |
22 return "style change"; | 22 return "style change"; |
23 case kPaintInvalidationForcedByLayout: | 23 case PaintInvalidationReason::kGeometry: |
24 return "forced by layout"; | 24 return "geometry"; |
25 case kPaintInvalidationCompositingUpdate: | 25 case PaintInvalidationReason::kCompositing: |
26 return "compositing update"; | 26 return "compositing update"; |
27 case kPaintInvalidationBorderBoxChange: | 27 case PaintInvalidationReason::kBackground: |
28 return "border box change"; | 28 return "background"; |
29 case kPaintInvalidationContentBoxChange: | 29 case PaintInvalidationReason::kAppeared: |
30 return "content box change"; | 30 return "appeared"; |
31 case kPaintInvalidationLayoutOverflowBoxChange: | 31 case PaintInvalidationReason::kDisappeared: |
32 return "layout overflow box change"; | 32 return "disappeared"; |
33 case kPaintInvalidationBoundsChange: | 33 case PaintInvalidationReason::kScroll: |
34 return "bounds change"; | |
35 case kPaintInvalidationLocationChange: | |
36 return "location change"; | |
37 case kPaintInvalidationBackgroundObscurationChange: | |
38 return "background obscuration change"; | |
39 case kPaintInvalidationBecameVisible: | |
40 return "became visible"; | |
41 case kPaintInvalidationBecameInvisible: | |
42 return "became invisible"; | |
43 case kPaintInvalidationScroll: | |
44 return "scroll"; | 34 return "scroll"; |
45 case kPaintInvalidationSelection: | 35 case PaintInvalidationReason::kScrollControl: |
| 36 return "scroll control"; |
| 37 case PaintInvalidationReason::kSelection: |
46 return "selection"; | 38 return "selection"; |
47 case kPaintInvalidationOutline: | 39 case PaintInvalidationReason::kOutline: |
48 return "outline"; | 40 return "outline"; |
49 case kPaintInvalidationSubtree: | 41 case PaintInvalidationReason::kSubtree: |
50 return "subtree"; | 42 return "subtree"; |
51 case kPaintInvalidationLayoutObjectInsertion: | 43 case PaintInvalidationReason::kSVGResource: |
52 return "layoutObject insertion"; | |
53 case kPaintInvalidationLayoutObjectRemoval: | |
54 return "layoutObject removal"; | |
55 case kPaintInvalidationSVGResourceChange: | |
56 return "SVG resource change"; | 44 return "SVG resource change"; |
57 case kPaintInvalidationBackgroundOnScrollingContentsLayer: | 45 case PaintInvalidationReason::kBackgroundOnScrollingContentsLayer: |
58 return "background on scrolling contents layer"; | 46 return "background on scrolling contents layer"; |
59 case kPaintInvalidationCaret: | 47 case PaintInvalidationReason::kCaret: |
60 return "caret"; | 48 return "caret"; |
61 case kPaintInvalidationViewBackground: | 49 case PaintInvalidationReason::kDocumentMarker: |
62 return "view background"; | |
63 case kPaintInvalidationDocumentMarkerChange: | |
64 return "DocumentMarker change"; | 50 return "DocumentMarker change"; |
65 case kPaintInvalidationForTesting: | 51 case PaintInvalidationReason::kImage: |
| 52 return "image"; |
| 53 case PaintInvalidationReason::kForTesting: |
66 return "for testing"; | 54 return "for testing"; |
67 case kPaintInvalidationDelayedFull: | 55 case PaintInvalidationReason::kDelayedFull: |
68 return "delayed full"; | 56 return "delayed full"; |
69 } | 57 } |
70 NOTREACHED(); | 58 NOTREACHED(); |
71 return ""; | 59 return ""; |
72 } | 60 } |
73 | 61 |
74 std::ostream& operator<<(std::ostream& out, PaintInvalidationReason reason) { | 62 std::ostream& operator<<(std::ostream& out, PaintInvalidationReason reason) { |
75 return out << PaintInvalidationReasonToString(reason); | 63 return out << PaintInvalidationReasonToString(reason); |
76 } | 64 } |
77 | 65 |
78 } // namespace blink | 66 } // namespace blink |
OLD | NEW |