| 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 #include "wtf/SizeAssertions.h" |
| 9 |
| 8 namespace blink { | 10 namespace blink { |
| 9 | 11 |
| 10 struct SameSizeAsDisplayItem { | 12 ASSERT_SIZE(DisplayItem, 16, 24); |
| 11 virtual ~SameSizeAsDisplayItem() { } // Allocate vtable pointer. | |
| 12 void* pointer; | |
| 13 int ints[2]; // Make sure other fields are packed into two ints. | |
| 14 #ifndef NDEBUG | |
| 15 WTF::String m_debugString; | |
| 16 #endif | |
| 17 }; | |
| 18 static_assert(sizeof(DisplayItem) == sizeof(SameSizeAsDisplayItem), "DisplayItem
should stay small"); | |
| 19 | 13 |
| 20 #ifndef NDEBUG | 14 #ifndef NDEBUG |
| 21 | 15 |
| 22 static WTF::String paintPhaseAsDebugString(int paintPhase) | 16 static WTF::String paintPhaseAsDebugString(int paintPhase) |
| 23 { | 17 { |
| 24 // Must be kept in sync with PaintPhase. | 18 // Must be kept in sync with PaintPhase. |
| 25 switch (paintPhase) { | 19 switch (paintPhase) { |
| 26 case 0: return "PaintPhaseBlockBackground"; | 20 case 0: return "PaintPhaseBlockBackground"; |
| 27 case 1: return "PaintPhaseChildBlockBackground"; | 21 case 1: return "PaintPhaseChildBlockBackground"; |
| 28 case 2: return "PaintPhaseChildBlockBackgrounds"; | 22 case 2: return "PaintPhaseChildBlockBackgrounds"; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 stringBuilder.append('"'); | 219 stringBuilder.append('"'); |
| 226 if (m_skippedCache) | 220 if (m_skippedCache) |
| 227 stringBuilder.append(", skippedCache: true"); | 221 stringBuilder.append(", skippedCache: true"); |
| 228 if (m_scope) | 222 if (m_scope) |
| 229 stringBuilder.append(String::format(", scope: %d", m_scope)); | 223 stringBuilder.append(String::format(", scope: %d", m_scope)); |
| 230 } | 224 } |
| 231 | 225 |
| 232 #endif | 226 #endif |
| 233 | 227 |
| 234 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |