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 "config.h" | 5 #include "config.h" |
6 #include "platform/graphics/paint/DisplayItem.h" | 6 #include "platform/graphics/paint/DisplayItem.h" |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 #ifndef NDEBUG | 10 #ifndef NDEBUG |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 case DisplayItem::ClipPopupListBoxFrame: return "ClipPopupListBoxFrame"; | 90 case DisplayItem::ClipPopupListBoxFrame: return "ClipPopupListBoxFrame"; |
91 case DisplayItem::ClipSelectionImage: return "ClipSelectionImage"; | 91 case DisplayItem::ClipSelectionImage: return "ClipSelectionImage"; |
92 case DisplayItem::PageWidgetDelegateClip: return "PageWidgetDelegateClip"; | 92 case DisplayItem::PageWidgetDelegateClip: return "PageWidgetDelegateClip"; |
93 case DisplayItem::TransparencyClip: return "TransparencyClip"; | 93 case DisplayItem::TransparencyClip: return "TransparencyClip"; |
94 default: | 94 default: |
95 ASSERT_NOT_REACHED(); | 95 ASSERT_NOT_REACHED(); |
96 return "Unknown"; | 96 return "Unknown"; |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
| 100 static String transform3DTypeAsDebugString(DisplayItem::Type type) |
| 101 { |
| 102 switch (type) { |
| 103 case DisplayItem::Transform3DElementTransform: return "Transform3DElementTra
nsform"; |
| 104 default: |
| 105 ASSERT_NOT_REACHED(); |
| 106 return "Unknown"; |
| 107 } |
| 108 } |
| 109 |
100 WTF::String DisplayItem::typeAsDebugString(Type type) | 110 WTF::String DisplayItem::typeAsDebugString(Type type) |
101 { | 111 { |
102 if (isDrawingType(type)) | 112 if (isDrawingType(type)) |
103 return drawingTypeAsDebugString(type); | 113 return drawingTypeAsDebugString(type); |
104 if (isCachedType(type)) | 114 if (isCachedType(type)) |
105 return "Cached" + drawingTypeAsDebugString(cachedTypeToDrawingType(type)
); | 115 return "Cached" + drawingTypeAsDebugString(cachedTypeToDrawingType(type)
); |
106 if (isClipType(type)) | 116 if (isClipType(type)) |
107 return clipTypeAsDebugString(type); | 117 return clipTypeAsDebugString(type); |
108 if (isEndClipType(type)) | 118 if (isEndClipType(type)) |
109 return "End" + clipTypeAsDebugString(endClipTypeToClipType(type)); | 119 return "End" + clipTypeAsDebugString(endClipTypeToClipType(type)); |
110 | 120 |
111 PAINT_PHASE_BASED_DEBUG_STRINGS(FloatClip); | 121 PAINT_PHASE_BASED_DEBUG_STRINGS(FloatClip); |
112 if (isEndFloatClipType(type)) | 122 if (isEndFloatClipType(type)) |
113 return "End" + typeAsDebugString(endFloatClipTypeToFloatClipType(type)); | 123 return "End" + typeAsDebugString(endFloatClipTypeToFloatClipType(type)); |
114 | 124 |
115 PAINT_PHASE_BASED_DEBUG_STRINGS(Scroll); | 125 PAINT_PHASE_BASED_DEBUG_STRINGS(Scroll); |
116 if (isEndScrollType(type)) | 126 if (isEndScrollType(type)) |
117 return "End" + typeAsDebugString(endScrollTypeToScrollType(type)); | 127 return "End" + typeAsDebugString(endScrollTypeToScrollType(type)); |
118 | 128 |
| 129 if (isTransform3DType(type)) |
| 130 return transform3DTypeAsDebugString(type); |
| 131 if (isEndTransform3DType(type)) |
| 132 return "End" + transform3DTypeAsDebugString(endTransform3DTypeToTransfor
m3DType(type)); |
| 133 |
119 PAINT_PHASE_BASED_DEBUG_STRINGS(SubtreeCached); | 134 PAINT_PHASE_BASED_DEBUG_STRINGS(SubtreeCached); |
120 PAINT_PHASE_BASED_DEBUG_STRINGS(BeginSubtree); | 135 PAINT_PHASE_BASED_DEBUG_STRINGS(BeginSubtree); |
121 PAINT_PHASE_BASED_DEBUG_STRINGS(EndSubtree); | 136 PAINT_PHASE_BASED_DEBUG_STRINGS(EndSubtree); |
122 | 137 |
123 switch (type) { | 138 switch (type) { |
124 case BeginFilter: return "BeginFilter"; | 139 case BeginFilter: return "BeginFilter"; |
125 case EndFilter: return "EndFilter"; | 140 case EndFilter: return "EndFilter"; |
126 case BeginCompositing: return "BeginCompositing"; | 141 case BeginCompositing: return "BeginCompositing"; |
127 case EndCompositing: return "EndCompositing"; | 142 case EndCompositing: return "EndCompositing"; |
128 case BeginTransform: return "BeginTransform"; | 143 case BeginTransform: return "BeginTransform"; |
129 case EndTransform: return "EndTransform"; | 144 case EndTransform: return "EndTransform"; |
130 case BeginTransform3D: return "BeginTransform3D"; | |
131 case EndTransform3D: return "EndTransform3D"; | |
132 case BeginClipPath: return "BeginClipPath"; | 145 case BeginClipPath: return "BeginClipPath"; |
133 case EndClipPath: return "EndClipPath"; | 146 case EndClipPath: return "EndClipPath"; |
134 default: | 147 default: |
135 ASSERT_NOT_REACHED(); | 148 ASSERT_NOT_REACHED(); |
136 return "Unknown"; | 149 return "Unknown"; |
137 } | 150 } |
138 } | 151 } |
139 | 152 |
140 WTF::String DisplayItem::asDebugString() const | 153 WTF::String DisplayItem::asDebugString() const |
141 { | 154 { |
(...skipping 14 matching lines...) Expand all Loading... |
156 stringBuilder.append("type: \""); | 169 stringBuilder.append("type: \""); |
157 stringBuilder.append(typeAsDebugString(type())); | 170 stringBuilder.append(typeAsDebugString(type())); |
158 stringBuilder.append('"'); | 171 stringBuilder.append('"'); |
159 if (m_id.scopeContainer) | 172 if (m_id.scopeContainer) |
160 stringBuilder.append(String::format(", scope: \"%p,%d\"", m_id.scopeCont
ainer, m_id.scopeId)); | 173 stringBuilder.append(String::format(", scope: \"%p,%d\"", m_id.scopeCont
ainer, m_id.scopeId)); |
161 } | 174 } |
162 | 175 |
163 #endif | 176 #endif |
164 | 177 |
165 } // namespace blink | 178 } // namespace blink |
OLD | NEW |