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/paint/DisplayItem.h" | 5 #include "platform/graphics/paint/DisplayItem.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 struct SameSizeAsDisplayItem { | 9 struct SameSizeAsDisplayItem { |
10 virtual ~SameSizeAsDisplayItem() { } // Allocate vtable pointer. | 10 virtual ~SameSizeAsDisplayItem() { } // Allocate vtable pointer. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return drawingTypeAsDebugString(type); | 187 return drawingTypeAsDebugString(type); |
188 | 188 |
189 if (isForeignLayerType(type)) | 189 if (isForeignLayerType(type)) |
190 return foreignLayerTypeAsDebugString(type); | 190 return foreignLayerTypeAsDebugString(type); |
191 | 191 |
192 if (isClipType(type)) | 192 if (isClipType(type)) |
193 return clipTypeAsDebugString(type); | 193 return clipTypeAsDebugString(type); |
194 if (isEndClipType(type)) | 194 if (isEndClipType(type)) |
195 return "End" + clipTypeAsDebugString(endClipTypeToClipType(type)); | 195 return "End" + clipTypeAsDebugString(endClipTypeToClipType(type)); |
196 | 196 |
197 if (type == kUninitializedType) | |
198 return "UninitializedType"; | |
199 | |
200 PAINT_PHASE_BASED_DEBUG_STRINGS(FloatClip); | 197 PAINT_PHASE_BASED_DEBUG_STRINGS(FloatClip); |
201 if (isEndFloatClipType(type)) | 198 if (isEndFloatClipType(type)) |
202 return "End" + typeAsDebugString(endFloatClipTypeToFloatClipType(type)); | 199 return "End" + typeAsDebugString(endFloatClipTypeToFloatClipType(type)); |
203 | 200 |
204 if (isScrollType(type)) | 201 if (isScrollType(type)) |
205 return scrollTypeAsDebugString(type); | 202 return scrollTypeAsDebugString(type); |
206 if (isEndScrollType(type)) | 203 if (isEndScrollType(type)) |
207 return "End" + scrollTypeAsDebugString(endScrollTypeToScrollType(type)); | 204 return "End" + scrollTypeAsDebugString(endScrollTypeToScrollType(type)); |
208 | 205 |
209 if (isTransform3DType(type)) | 206 if (isTransform3DType(type)) |
210 return transform3DTypeAsDebugString(type); | 207 return transform3DTypeAsDebugString(type); |
211 if (isEndTransform3DType(type)) | 208 if (isEndTransform3DType(type)) |
212 return "End" + transform3DTypeAsDebugString(endTransform3DTypeToTransfor
m3DType(type)); | 209 return "End" + transform3DTypeAsDebugString(endTransform3DTypeToTransfor
m3DType(type)); |
213 | 210 |
214 switch (type) { | 211 switch (type) { |
215 DEBUG_STRING_CASE(BeginFilter); | 212 DEBUG_STRING_CASE(BeginFilter); |
216 DEBUG_STRING_CASE(EndFilter); | 213 DEBUG_STRING_CASE(EndFilter); |
217 DEBUG_STRING_CASE(BeginCompositing); | 214 DEBUG_STRING_CASE(BeginCompositing); |
218 DEBUG_STRING_CASE(EndCompositing); | 215 DEBUG_STRING_CASE(EndCompositing); |
219 DEBUG_STRING_CASE(BeginTransform); | 216 DEBUG_STRING_CASE(BeginTransform); |
220 DEBUG_STRING_CASE(EndTransform); | 217 DEBUG_STRING_CASE(EndTransform); |
221 DEBUG_STRING_CASE(BeginClipPath); | 218 DEBUG_STRING_CASE(BeginClipPath); |
222 DEBUG_STRING_CASE(EndClipPath); | 219 DEBUG_STRING_CASE(EndClipPath); |
223 DEBUG_STRING_CASE(Subsequence); | 220 DEBUG_STRING_CASE(Subsequence); |
224 DEBUG_STRING_CASE(EndSubsequence); | 221 DEBUG_STRING_CASE(EndSubsequence); |
| 222 DEBUG_STRING_CASE(HasBeenMoved); |
225 DEBUG_STRING_CASE(UninitializedType); | 223 DEBUG_STRING_CASE(UninitializedType); |
226 DEFAULT_CASE; | 224 DEFAULT_CASE; |
227 } | 225 } |
228 } | 226 } |
229 | 227 |
230 WTF::String DisplayItem::asDebugString() const | 228 WTF::String DisplayItem::asDebugString() const |
231 { | 229 { |
232 WTF::StringBuilder stringBuilder; | 230 WTF::StringBuilder stringBuilder; |
233 stringBuilder.append('{'); | 231 stringBuilder.append('{'); |
234 dumpPropertiesAsDebugString(stringBuilder); | 232 dumpPropertiesAsDebugString(stringBuilder); |
235 stringBuilder.append('}'); | 233 stringBuilder.append('}'); |
236 return stringBuilder.toString(); | 234 return stringBuilder.toString(); |
237 } | 235 } |
238 | 236 |
239 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder)
const | 237 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder)
const |
240 { | 238 { |
241 if (!hasValidClient()) { | 239 if (hasBeenMoved()) { |
242 stringBuilder.append("validClient: false, originalDebugString: "); | 240 stringBuilder.append("movedTo: %zu, originalDebugString: ", movedToIndex
()); |
243 // This is the original debug string which is in json format. | 241 // This is the original debug string which is in json format. |
244 stringBuilder.append(clientDebugString()); | 242 stringBuilder.append(clientDebugString()); |
245 return; | 243 return; |
246 } | 244 } |
247 | 245 |
248 stringBuilder.append(String::format("client: \"%p", &client())); | 246 stringBuilder.append(String::format("client: \"%p", &client())); |
249 if (!clientDebugString().isEmpty()) { | 247 if (!clientDebugString().isEmpty()) { |
250 stringBuilder.append(' '); | 248 stringBuilder.append(' '); |
251 stringBuilder.append(clientDebugString()); | 249 stringBuilder.append(clientDebugString()); |
252 } | 250 } |
253 stringBuilder.append("\", type: \""); | 251 stringBuilder.append("\", type: \""); |
254 stringBuilder.append(typeAsDebugString(getType())); | 252 stringBuilder.append(typeAsDebugString(getType())); |
255 stringBuilder.append('"'); | 253 stringBuilder.append('"'); |
256 if (m_skippedCache) | 254 if (m_skippedCache) |
257 stringBuilder.append(", skippedCache: true"); | 255 stringBuilder.append(", skippedCache: true"); |
258 } | 256 } |
259 | 257 |
260 #endif | 258 #endif |
261 | 259 |
262 } // namespace blink | 260 } // namespace blink |
OLD | NEW |