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

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

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: fix typo Created 3 years, 8 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 29 matching lines...) Expand all
40 return "PaintPhaseChildOutlines"; 40 return "PaintPhaseChildOutlines";
41 case 8: 41 case 8:
42 return "PaintPhaseSelection"; 42 return "PaintPhaseSelection";
43 case 9: 43 case 9:
44 return "PaintPhaseTextClip"; 44 return "PaintPhaseTextClip";
45 case 10: 45 case 10:
46 return "PaintPhaseMask"; 46 return "PaintPhaseMask";
47 case DisplayItem::kPaintPhaseMax: 47 case DisplayItem::kPaintPhaseMax:
48 return "PaintPhaseClippingMask"; 48 return "PaintPhaseClippingMask";
49 default: 49 default:
50 ASSERT_NOT_REACHED(); 50 NOTREACHED();
51 return "Unknown"; 51 return "Unknown";
52 } 52 }
53 } 53 }
54 54
55 #define PAINT_PHASE_BASED_DEBUG_STRINGS(Category) \ 55 #define PAINT_PHASE_BASED_DEBUG_STRINGS(Category) \
56 if (type >= DisplayItem::k##Category##PaintPhaseFirst && \ 56 if (type >= DisplayItem::k##Category##PaintPhaseFirst && \
57 type <= DisplayItem::k##Category##PaintPhaseLast) \ 57 type <= DisplayItem::k##Category##PaintPhaseLast) \
58 return #Category + PaintPhaseAsDebugString( \ 58 return #Category + PaintPhaseAsDebugString( \
59 type - DisplayItem::k##Category##PaintPhaseFirst); 59 type - DisplayItem::k##Category##PaintPhaseFirst);
60 60
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 NOTREACHED(); \
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) { 71 if (type >= DisplayItem::kTableCollapsedBorderUnalignedBase) {
72 if (type <= DisplayItem::kTableCollapsedBorderBase) 72 if (type <= DisplayItem::kTableCollapsedBorderBase)
73 return "TableCollapsedBorderAlignment"; 73 return "TableCollapsedBorderAlignment";
74 if (type <= DisplayItem::kTableCollapsedBorderLast) { 74 if (type <= DisplayItem::kTableCollapsedBorderLast) {
75 StringBuilder sb; 75 StringBuilder sb;
76 sb.Append("TableCollapsedBorder"); 76 sb.Append("TableCollapsedBorder");
77 if (type & DisplayItem::kTableCollapsedBorderTop) 77 if (type & DisplayItem::kTableCollapsedBorderTop)
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 string_builder.Append("\", type: \""); 247 string_builder.Append("\", type: \"");
248 string_builder.Append(TypeAsDebugString(GetType())); 248 string_builder.Append(TypeAsDebugString(GetType()));
249 string_builder.Append('"'); 249 string_builder.Append('"');
250 if (skipped_cache_) 250 if (skipped_cache_)
251 string_builder.Append(", skippedCache: true"); 251 string_builder.Append(", skippedCache: true");
252 } 252 }
253 253
254 #endif 254 #endif
255 255
256 } // namespace blink 256 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698