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

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

Issue 2286843002: Rename DisplayItem::Type enum constants to Chromium style. (Closed)
Patch Set: Rebasing... Created 4 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
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 "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 15 matching lines...) Expand all
26 case 1: return "PaintPhaseSelfBlockBackground"; 26 case 1: return "PaintPhaseSelfBlockBackground";
27 case 2: return "PaintPhaseChildBlockBackgrounds"; 27 case 2: return "PaintPhaseChildBlockBackgrounds";
28 case 3: return "PaintPhaseFloat"; 28 case 3: return "PaintPhaseFloat";
29 case 4: return "PaintPhaseForeground"; 29 case 4: return "PaintPhaseForeground";
30 case 5: return "PaintPhaseOutline"; 30 case 5: return "PaintPhaseOutline";
31 case 6: return "PaintPhaseSelfOutline"; 31 case 6: return "PaintPhaseSelfOutline";
32 case 7: return "PaintPhaseChildOutlines"; 32 case 7: return "PaintPhaseChildOutlines";
33 case 8: return "PaintPhaseSelection"; 33 case 8: return "PaintPhaseSelection";
34 case 9: return "PaintPhaseTextClip"; 34 case 9: return "PaintPhaseTextClip";
35 case 10: return "PaintPhaseMask"; 35 case 10: return "PaintPhaseMask";
36 case DisplayItem::PaintPhaseMax: return "PaintPhaseClippingMask"; 36 case DisplayItem::kPaintPhaseMax: return "PaintPhaseClippingMask";
37 default: 37 default:
38 ASSERT_NOT_REACHED(); 38 ASSERT_NOT_REACHED();
39 return "Unknown"; 39 return "Unknown";
40 } 40 }
41 } 41 }
42 42
43 #define PAINT_PHASE_BASED_DEBUG_STRINGS(Category) \ 43 #define PAINT_PHASE_BASED_DEBUG_STRINGS(Category) \
44 if (type >= DisplayItem::Category##PaintPhaseFirst && type <= DisplayItem::C ategory##PaintPhaseLast) \ 44 if (type >= DisplayItem::k##Category##PaintPhaseFirst && type <= DisplayItem ::k##Category##PaintPhaseLast) \
45 return #Category + paintPhaseAsDebugString(type - DisplayItem::Category# #PaintPhaseFirst); 45 return #Category + paintPhaseAsDebugString(type - DisplayItem::k##Catego ry##PaintPhaseFirst);
46 46
47 #define DEBUG_STRING_CASE(DisplayItemName) \ 47 #define DEBUG_STRING_CASE(DisplayItemName) \
48 case DisplayItem::DisplayItemName: return #DisplayItemName 48 case DisplayItem::k##DisplayItemName: return #DisplayItemName
49 49
50 #define DEFAULT_CASE default: ASSERT_NOT_REACHED(); return "Unknown" 50 #define DEFAULT_CASE default: ASSERT_NOT_REACHED(); return "Unknown"
51 51
52 static WTF::String specialDrawingTypeAsDebugString(DisplayItem::Type type) 52 static WTF::String specialDrawingTypeAsDebugString(DisplayItem::Type type)
53 { 53 {
54 if (type >= DisplayItem::TableCollapsedBorderUnalignedBase) { 54 if (type >= DisplayItem::kTableCollapsedBorderUnalignedBase) {
55 if (type <= DisplayItem::TableCollapsedBorderBase) 55 if (type <= DisplayItem::kTableCollapsedBorderBase)
56 return "TableCollapsedBorderAlignment"; 56 return "TableCollapsedBorderAlignment";
57 if (type <= DisplayItem::TableCollapsedBorderLast) { 57 if (type <= DisplayItem::kTableCollapsedBorderLast) {
58 StringBuilder sb; 58 StringBuilder sb;
59 sb.append("TableCollapsedBorder"); 59 sb.append("TableCollapsedBorder");
60 if (type & DisplayItem::TableCollapsedBorderTop) 60 if (type & DisplayItem::TableCollapsedBorderTop)
61 sb.append("Top"); 61 sb.append("Top");
62 if (type & DisplayItem::TableCollapsedBorderRight) 62 if (type & DisplayItem::TableCollapsedBorderRight)
63 sb.append("Right"); 63 sb.append("Right");
64 if (type & DisplayItem::TableCollapsedBorderBottom) 64 if (type & DisplayItem::TableCollapsedBorderBottom)
65 sb.append("Bottom"); 65 sb.append("Bottom");
66 if (type & DisplayItem::TableCollapsedBorderLeft) 66 if (type & DisplayItem::TableCollapsedBorderLeft)
67 sb.append("Left"); 67 sb.append("Left");
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return drawingTypeAsDebugString(type); 187 return drawingTypeAsDebugString(type);
188 188
189 if (isForeignLayerType(type)) 189 if (isForeignLayerType(type))
190 return foreignLayerTypeAsDebugString(type); 190 return foreignLayerTypeAsDebugString(type);
191 191
192 if (isClipType(type)) 192 if (isClipType(type))
193 return clipTypeAsDebugString(type); 193 return clipTypeAsDebugString(type);
194 if (isEndClipType(type)) 194 if (isEndClipType(type))
195 return "End" + clipTypeAsDebugString(endClipTypeToClipType(type)); 195 return "End" + clipTypeAsDebugString(endClipTypeToClipType(type));
196 196
197 if (type == UninitializedType) 197 if (type == kUninitializedType)
198 return "UninitializedType"; 198 return "UninitializedType";
199 199
200 PAINT_PHASE_BASED_DEBUG_STRINGS(FloatClip); 200 PAINT_PHASE_BASED_DEBUG_STRINGS(FloatClip);
201 if (isEndFloatClipType(type)) 201 if (isEndFloatClipType(type))
202 return "End" + typeAsDebugString(endFloatClipTypeToFloatClipType(type)); 202 return "End" + typeAsDebugString(endFloatClipTypeToFloatClipType(type));
203 203
204 if (isScrollType(type)) 204 if (isScrollType(type))
205 return scrollTypeAsDebugString(type); 205 return scrollTypeAsDebugString(type);
206 if (isEndScrollType(type)) 206 if (isEndScrollType(type))
207 return "End" + scrollTypeAsDebugString(endScrollTypeToScrollType(type)); 207 return "End" + scrollTypeAsDebugString(endScrollTypeToScrollType(type));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 stringBuilder.append("\", type: \""); 253 stringBuilder.append("\", type: \"");
254 stringBuilder.append(typeAsDebugString(getType())); 254 stringBuilder.append(typeAsDebugString(getType()));
255 stringBuilder.append('"'); 255 stringBuilder.append('"');
256 if (m_skippedCache) 256 if (m_skippedCache)
257 stringBuilder.append(", skippedCache: true"); 257 stringBuilder.append(", skippedCache: true");
258 } 258 }
259 259
260 #endif 260 #endif
261 261
262 } // namespace blink 262 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698