Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: Source/platform/graphics/paint/DisplayItem.cpp

Issue 1323263002: Show debug information for invalid display items (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 struct SameSizeAsDisplayItem { 10 struct SameSizeAsDisplayItem {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 DEBUG_STRING_CASE(BeginSubsequence); 196 DEBUG_STRING_CASE(BeginSubsequence);
197 DEBUG_STRING_CASE(EndSubsequence); 197 DEBUG_STRING_CASE(EndSubsequence);
198 DEBUG_STRING_CASE(CachedSubsequence); 198 DEBUG_STRING_CASE(CachedSubsequence);
199 DEBUG_STRING_CASE(UninitializedType); 199 DEBUG_STRING_CASE(UninitializedType);
200 DEFAULT_CASE; 200 DEFAULT_CASE;
201 } 201 }
202 } 202 }
203 203
204 WTF::String DisplayItem::asDebugString() const 204 WTF::String DisplayItem::asDebugString() const
205 { 205 {
206 if (!isValid())
207 return "null";
208 WTF::StringBuilder stringBuilder; 206 WTF::StringBuilder stringBuilder;
209 stringBuilder.append('{'); 207 stringBuilder.append('{');
210 dumpPropertiesAsDebugString(stringBuilder); 208 dumpPropertiesAsDebugString(stringBuilder);
211 stringBuilder.append('}'); 209 stringBuilder.append('}');
212 return stringBuilder.toString(); 210 return stringBuilder.toString();
213 } 211 }
214 212
215 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const 213 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const
216 { 214 {
217 ASSERT(isValid()); 215 if (!isValid()) {
216 stringBuilder.append("valid: false, originalDebugString: ");
217 stringBuilder.append(clientDebugString());
pdr. 2015/09/03 01:59:20 Can you add quotes around this so it's valid-ish j
Xianzhu 2015/09/03 05:48:44 It's the original display item's debug string whic
218 return;
219 }
220
218 stringBuilder.append(String::format("client: \"%p", client())); 221 stringBuilder.append(String::format("client: \"%p", client()));
219 if (!clientDebugString().isEmpty()) { 222 if (!clientDebugString().isEmpty()) {
220 stringBuilder.append(' '); 223 stringBuilder.append(' ');
221 stringBuilder.append(clientDebugString()); 224 stringBuilder.append(clientDebugString());
222 } 225 }
223 stringBuilder.append("\", type: \""); 226 stringBuilder.append("\", type: \"");
224 stringBuilder.append(typeAsDebugString(type())); 227 stringBuilder.append(typeAsDebugString(type()));
225 stringBuilder.append('"'); 228 stringBuilder.append('"');
226 if (m_skippedCache) 229 if (m_skippedCache)
227 stringBuilder.append(", skippedCache: true"); 230 stringBuilder.append(", skippedCache: true");
228 if (m_scope) 231 if (m_scope)
229 stringBuilder.append(String::format(", scope: %d", m_scope)); 232 stringBuilder.append(String::format(", scope: %d", m_scope));
230 } 233 }
231 234
232 #endif 235 #endif
233 236
234 } // namespace blink 237 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/DisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698