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 struct SameSizeAsDisplayItem { | 10 struct SameSizeAsDisplayItem { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 DEBUG_STRING_CASE(BeginFixedPosition); | 183 DEBUG_STRING_CASE(BeginFixedPosition); |
184 DEBUG_STRING_CASE(EndFixedPosition); | 184 DEBUG_STRING_CASE(EndFixedPosition); |
185 DEBUG_STRING_CASE(BeginFixedPositionContainer); | 185 DEBUG_STRING_CASE(BeginFixedPositionContainer); |
186 DEBUG_STRING_CASE(EndFixedPositionContainer); | 186 DEBUG_STRING_CASE(EndFixedPositionContainer); |
187 DEFAULT_CASE; | 187 DEFAULT_CASE; |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 WTF::String DisplayItem::asDebugString() const | 191 WTF::String DisplayItem::asDebugString() const |
192 { | 192 { |
| 193 if (!isValid()) |
| 194 return "null"; |
193 WTF::StringBuilder stringBuilder; | 195 WTF::StringBuilder stringBuilder; |
194 stringBuilder.append('{'); | 196 stringBuilder.append('{'); |
195 dumpPropertiesAsDebugString(stringBuilder); | 197 dumpPropertiesAsDebugString(stringBuilder); |
196 stringBuilder.append('}'); | 198 stringBuilder.append('}'); |
197 return stringBuilder.toString(); | 199 return stringBuilder.toString(); |
198 } | 200 } |
199 | 201 |
200 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder)
const | 202 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder)
const |
201 { | 203 { |
| 204 ASSERT(isValid()); |
202 stringBuilder.append(String::format("client: \"%p", client())); | 205 stringBuilder.append(String::format("client: \"%p", client())); |
203 if (!clientDebugString().isEmpty()) { | 206 if (!clientDebugString().isEmpty()) { |
204 stringBuilder.append(' '); | 207 stringBuilder.append(' '); |
205 stringBuilder.append(clientDebugString()); | 208 stringBuilder.append(clientDebugString()); |
206 } | 209 } |
207 stringBuilder.append("\", type: \""); | 210 stringBuilder.append("\", type: \""); |
208 stringBuilder.append(typeAsDebugString(type())); | 211 stringBuilder.append(typeAsDebugString(type())); |
209 stringBuilder.append('"'); | 212 stringBuilder.append('"'); |
210 if (m_skippedCache) | 213 if (m_skippedCache) |
211 stringBuilder.append(", skippedCache: true"); | 214 stringBuilder.append(", skippedCache: true"); |
212 if (m_scope) | 215 if (m_scope) |
213 stringBuilder.append(String::format(", scope: %d", m_scope)); | 216 stringBuilder.append(String::format(", scope: %d", m_scope)); |
214 } | 217 } |
215 | 218 |
216 #endif | 219 #endif |
217 | 220 |
218 } // namespace blink | 221 } // namespace blink |
OLD | NEW |