| 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 } | |
| 88 switch (type) { | 71 switch (type) { |
| 89 DEBUG_STRING_CASE(BoxDecorationBackground); | 72 DEBUG_STRING_CASE(BoxDecorationBackground); |
| 90 DEBUG_STRING_CASE(Caret); | 73 DEBUG_STRING_CASE(Caret); |
| 91 DEBUG_STRING_CASE(ColumnRules); | 74 DEBUG_STRING_CASE(ColumnRules); |
| 92 DEBUG_STRING_CASE(DebugDrawing); | 75 DEBUG_STRING_CASE(DebugDrawing); |
| 93 DEBUG_STRING_CASE(DocumentBackground); | 76 DEBUG_STRING_CASE(DocumentBackground); |
| 94 DEBUG_STRING_CASE(DragImage); | 77 DEBUG_STRING_CASE(DragImage); |
| 95 DEBUG_STRING_CASE(DragCaret); | 78 DEBUG_STRING_CASE(DragCaret); |
| 96 DEBUG_STRING_CASE(SVGImage); | 79 DEBUG_STRING_CASE(SVGImage); |
| 97 DEBUG_STRING_CASE(LinkHighlight); | 80 DEBUG_STRING_CASE(LinkHighlight); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 119 DEBUG_STRING_CASE(ScrollbarForwardTrack); | 102 DEBUG_STRING_CASE(ScrollbarForwardTrack); |
| 120 DEBUG_STRING_CASE(ScrollbarThumb); | 103 DEBUG_STRING_CASE(ScrollbarThumb); |
| 121 DEBUG_STRING_CASE(ScrollbarTickmarks); | 104 DEBUG_STRING_CASE(ScrollbarTickmarks); |
| 122 DEBUG_STRING_CASE(ScrollbarTrackBackground); | 105 DEBUG_STRING_CASE(ScrollbarTrackBackground); |
| 123 DEBUG_STRING_CASE(ScrollbarCompositedScrollbar); | 106 DEBUG_STRING_CASE(ScrollbarCompositedScrollbar); |
| 124 DEBUG_STRING_CASE(SelectionTint); | 107 DEBUG_STRING_CASE(SelectionTint); |
| 125 DEBUG_STRING_CASE(TableCellBackgroundFromColumnGroup); | 108 DEBUG_STRING_CASE(TableCellBackgroundFromColumnGroup); |
| 126 DEBUG_STRING_CASE(TableCellBackgroundFromColumn); | 109 DEBUG_STRING_CASE(TableCellBackgroundFromColumn); |
| 127 DEBUG_STRING_CASE(TableCellBackgroundFromSection); | 110 DEBUG_STRING_CASE(TableCellBackgroundFromSection); |
| 128 DEBUG_STRING_CASE(TableCellBackgroundFromRow); | 111 DEBUG_STRING_CASE(TableCellBackgroundFromRow); |
| 112 DEBUG_STRING_CASE(TableCollapsedBorders); |
| 129 DEBUG_STRING_CASE(TableSectionBoxShadowInset); | 113 DEBUG_STRING_CASE(TableSectionBoxShadowInset); |
| 130 DEBUG_STRING_CASE(TableSectionBoxShadowNormal); | 114 DEBUG_STRING_CASE(TableSectionBoxShadowNormal); |
| 131 DEBUG_STRING_CASE(TableRowBoxShadowInset); | 115 DEBUG_STRING_CASE(TableRowBoxShadowInset); |
| 132 DEBUG_STRING_CASE(TableRowBoxShadowNormal); | 116 DEBUG_STRING_CASE(TableRowBoxShadowNormal); |
| 133 DEBUG_STRING_CASE(VideoBitmap); | 117 DEBUG_STRING_CASE(VideoBitmap); |
| 134 DEBUG_STRING_CASE(WebPlugin); | 118 DEBUG_STRING_CASE(WebPlugin); |
| 135 DEBUG_STRING_CASE(WebFont); | 119 DEBUG_STRING_CASE(WebFont); |
| 136 DEBUG_STRING_CASE(ReflectionMask); | 120 DEBUG_STRING_CASE(ReflectionMask); |
| 137 | 121 |
| 138 DEFAULT_CASE; | 122 DEFAULT_CASE; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 stringBuilder.append("\", type: \""); | 245 stringBuilder.append("\", type: \""); |
| 262 stringBuilder.append(typeAsDebugString(getType())); | 246 stringBuilder.append(typeAsDebugString(getType())); |
| 263 stringBuilder.append('"'); | 247 stringBuilder.append('"'); |
| 264 if (m_skippedCache) | 248 if (m_skippedCache) |
| 265 stringBuilder.append(", skippedCache: true"); | 249 stringBuilder.append(", skippedCache: true"); |
| 266 } | 250 } |
| 267 | 251 |
| 268 #endif | 252 #endif |
| 269 | 253 |
| 270 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |