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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #define DEBUG_STRING_CASE(DisplayItemName) \ | 61 #define DEBUG_STRING_CASE(DisplayItemName) \ |
62 case DisplayItem::k##DisplayItemName: \ | 62 case DisplayItem::k##DisplayItemName: \ |
63 return #DisplayItemName | 63 return #DisplayItemName |
64 | 64 |
65 #define DEFAULT_CASE \ | 65 #define DEFAULT_CASE \ |
66 default: \ | 66 default: \ |
67 ASSERT_NOT_REACHED(); \ | 67 ASSERT_NOT_REACHED(); \ |
68 return "Unknown" | 68 return "Unknown" |
69 | 69 |
70 static WTF::String specialDrawingTypeAsDebugString(DisplayItem::Type type) { | 70 static WTF::String specialDrawingTypeAsDebugString(DisplayItem::Type type) { |
| 71 if (type >= DisplayItem::kTableCollapsedBorderUnalignedBase) { |
| 72 if (type <= DisplayItem::kTableCollapsedBorderBase) |
| 73 return "TableCollapsedBorderAlignment"; |
| 74 if (type <= DisplayItem::kTableCollapsedBorderLast) { |
| 75 StringBuilder sb; |
| 76 sb.append("TableCollapsedBorder"); |
| 77 if (type & DisplayItem::TableCollapsedBorderTop) |
| 78 sb.append("Top"); |
| 79 if (type & DisplayItem::TableCollapsedBorderRight) |
| 80 sb.append("Right"); |
| 81 if (type & DisplayItem::TableCollapsedBorderBottom) |
| 82 sb.append("Bottom"); |
| 83 if (type & DisplayItem::TableCollapsedBorderLeft) |
| 84 sb.append("Left"); |
| 85 return sb.toString(); |
| 86 } |
| 87 } |
71 switch (type) { | 88 switch (type) { |
72 DEBUG_STRING_CASE(BoxDecorationBackground); | 89 DEBUG_STRING_CASE(BoxDecorationBackground); |
73 DEBUG_STRING_CASE(Caret); | 90 DEBUG_STRING_CASE(Caret); |
74 DEBUG_STRING_CASE(ColumnRules); | 91 DEBUG_STRING_CASE(ColumnRules); |
75 DEBUG_STRING_CASE(DebugDrawing); | 92 DEBUG_STRING_CASE(DebugDrawing); |
76 DEBUG_STRING_CASE(DocumentBackground); | 93 DEBUG_STRING_CASE(DocumentBackground); |
77 DEBUG_STRING_CASE(DragImage); | 94 DEBUG_STRING_CASE(DragImage); |
78 DEBUG_STRING_CASE(DragCaret); | 95 DEBUG_STRING_CASE(DragCaret); |
79 DEBUG_STRING_CASE(SVGImage); | 96 DEBUG_STRING_CASE(SVGImage); |
80 DEBUG_STRING_CASE(LinkHighlight); | 97 DEBUG_STRING_CASE(LinkHighlight); |
(...skipping 21 matching lines...) Expand all Loading... |
102 DEBUG_STRING_CASE(ScrollbarForwardTrack); | 119 DEBUG_STRING_CASE(ScrollbarForwardTrack); |
103 DEBUG_STRING_CASE(ScrollbarThumb); | 120 DEBUG_STRING_CASE(ScrollbarThumb); |
104 DEBUG_STRING_CASE(ScrollbarTickmarks); | 121 DEBUG_STRING_CASE(ScrollbarTickmarks); |
105 DEBUG_STRING_CASE(ScrollbarTrackBackground); | 122 DEBUG_STRING_CASE(ScrollbarTrackBackground); |
106 DEBUG_STRING_CASE(ScrollbarCompositedScrollbar); | 123 DEBUG_STRING_CASE(ScrollbarCompositedScrollbar); |
107 DEBUG_STRING_CASE(SelectionTint); | 124 DEBUG_STRING_CASE(SelectionTint); |
108 DEBUG_STRING_CASE(TableCellBackgroundFromColumnGroup); | 125 DEBUG_STRING_CASE(TableCellBackgroundFromColumnGroup); |
109 DEBUG_STRING_CASE(TableCellBackgroundFromColumn); | 126 DEBUG_STRING_CASE(TableCellBackgroundFromColumn); |
110 DEBUG_STRING_CASE(TableCellBackgroundFromSection); | 127 DEBUG_STRING_CASE(TableCellBackgroundFromSection); |
111 DEBUG_STRING_CASE(TableCellBackgroundFromRow); | 128 DEBUG_STRING_CASE(TableCellBackgroundFromRow); |
112 DEBUG_STRING_CASE(TableCollapsedBorders); | |
113 DEBUG_STRING_CASE(TableSectionBoxShadowInset); | 129 DEBUG_STRING_CASE(TableSectionBoxShadowInset); |
114 DEBUG_STRING_CASE(TableSectionBoxShadowNormal); | 130 DEBUG_STRING_CASE(TableSectionBoxShadowNormal); |
115 DEBUG_STRING_CASE(TableRowBoxShadowInset); | 131 DEBUG_STRING_CASE(TableRowBoxShadowInset); |
116 DEBUG_STRING_CASE(TableRowBoxShadowNormal); | 132 DEBUG_STRING_CASE(TableRowBoxShadowNormal); |
117 DEBUG_STRING_CASE(VideoBitmap); | 133 DEBUG_STRING_CASE(VideoBitmap); |
118 DEBUG_STRING_CASE(WebPlugin); | 134 DEBUG_STRING_CASE(WebPlugin); |
119 DEBUG_STRING_CASE(WebFont); | 135 DEBUG_STRING_CASE(WebFont); |
120 DEBUG_STRING_CASE(ReflectionMask); | 136 DEBUG_STRING_CASE(ReflectionMask); |
121 | 137 |
122 DEFAULT_CASE; | 138 DEFAULT_CASE; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 stringBuilder.append("\", type: \""); | 261 stringBuilder.append("\", type: \""); |
246 stringBuilder.append(typeAsDebugString(getType())); | 262 stringBuilder.append(typeAsDebugString(getType())); |
247 stringBuilder.append('"'); | 263 stringBuilder.append('"'); |
248 if (m_skippedCache) | 264 if (m_skippedCache) |
249 stringBuilder.append(", skippedCache: true"); | 265 stringBuilder.append(", skippedCache: true"); |
250 } | 266 } |
251 | 267 |
252 #endif | 268 #endif |
253 | 269 |
254 } // namespace blink | 270 } // namespace blink |
OLD | NEW |