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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h

Issue 2286843002: Rename DisplayItem::Type enum constants to Chromium style. (Closed)
Patch Set: Rebasing... Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
index 6c8c994367deac902d0c2b3a0568c9b2ace2e05a..0cc8cf31997441ee3289b0ae76d1314c6df377de 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
@@ -30,7 +30,7 @@ class PLATFORM_EXPORT DisplayItem {
public:
enum {
// Must be kept in sync with core/paint/PaintPhase.h.
- PaintPhaseMax = 11,
+ kPaintPhaseMax = 11,
};
// A display item type uniquely identifies a display item of a client.
@@ -57,137 +57,137 @@ public:
// - DEFINE_CONVERSION_METHODS(<Category>, <category>, <BaseCategory>, <baseCategory>) to define methods to
// convert types between the categories;
enum Type {
- DrawingFirst,
- DrawingPaintPhaseFirst = DrawingFirst,
- DrawingPaintPhaseLast = DrawingFirst + PaintPhaseMax,
- BoxDecorationBackground,
- Caret,
- ColumnRules,
- DebugDrawing,
- DocumentBackground,
- DragImage,
- DragCaret,
- SVGImage,
- LinkHighlight,
- ImageAreaFocusRing,
- PageOverlay,
- PageWidgetDelegateBackgroundFallback,
- PopupContainerBorder,
- PopupListBoxBackground,
- PopupListBoxRow,
- PrintedContentBackground,
- PrintedContentDestinationLocations,
- PrintedContentLineBoundary,
- PrintedContentPDFURLRect,
- Resizer,
- SVGClip,
- SVGFilter,
- SVGMask,
- ScrollbarBackButtonEnd,
- ScrollbarBackButtonStart,
- ScrollbarBackground,
- ScrollbarBackTrack,
- ScrollbarCorner,
- ScrollbarForwardButtonEnd,
- ScrollbarForwardButtonStart,
- ScrollbarForwardTrack,
- ScrollbarThumb,
- ScrollbarTickmarks,
- ScrollbarTrackBackground,
- ScrollbarCompositedScrollbar,
- SelectionTint,
- TableCellBackgroundFromColumnGroup,
- TableCellBackgroundFromColumn,
- TableCellBackgroundFromSection,
- TableCellBackgroundFromRow,
+ kDrawingFirst,
+ kDrawingPaintPhaseFirst = kDrawingFirst,
+ kDrawingPaintPhaseLast = kDrawingFirst + kPaintPhaseMax,
+ kBoxDecorationBackground,
+ kCaret,
+ kColumnRules,
+ kDebugDrawing,
+ kDocumentBackground,
+ kDragImage,
+ kDragCaret,
+ kSVGImage,
+ kLinkHighlight,
+ kImageAreaFocusRing,
+ kPageOverlay,
+ kPageWidgetDelegateBackgroundFallback,
+ kPopupContainerBorder,
+ kPopupListBoxBackground,
+ kPopupListBoxRow,
+ kPrintedContentBackground,
+ kPrintedContentDestinationLocations,
+ kPrintedContentLineBoundary,
+ kPrintedContentPDFURLRect,
+ kResizer,
+ kSVGClip,
+ kSVGFilter,
+ kSVGMask,
+ kScrollbarBackButtonEnd,
+ kScrollbarBackButtonStart,
+ kScrollbarBackground,
+ kScrollbarBackTrack,
+ kScrollbarCorner,
+ kScrollbarForwardButtonEnd,
+ kScrollbarForwardButtonStart,
+ kScrollbarForwardTrack,
+ kScrollbarThumb,
+ kScrollbarTickmarks,
+ kScrollbarTrackBackground,
+ kScrollbarCompositedScrollbar,
+ kSelectionTint,
+ kTableCellBackgroundFromColumnGroup,
+ kTableCellBackgroundFromColumn,
+ kTableCellBackgroundFromSection,
+ kTableCellBackgroundFromRow,
// Table collapsed borders can be painted together (e.g., left & top) but there are at most 4 phases of collapsed
// border painting for a single cell. To disambiguate these phases of collapsed border painting, a mask is used.
// TableCollapsedBorderBase can be larger than TableCollapsedBorderUnalignedBase to ensure the base lower bits are 0's.
- TableCollapsedBorderUnalignedBase,
- TableCollapsedBorderBase = (((TableCollapsedBorderUnalignedBase - 1) >> 4) + 1) << 4,
- TableCollapsedBorderLast = TableCollapsedBorderBase + 0x0f,
- TableSectionBoxShadowInset,
- TableSectionBoxShadowNormal,
- TableRowBoxShadowInset,
- TableRowBoxShadowNormal,
- VideoBitmap,
- WebPlugin,
- WebFont,
- ReflectionMask,
- DrawingLast = ReflectionMask,
-
- ForeignLayerFirst,
- ForeignLayerCanvas = ForeignLayerFirst,
- ForeignLayerPlugin,
- ForeignLayerVideo,
- ForeignLayerLast = ForeignLayerVideo,
-
- ClipFirst,
- ClipBoxPaintPhaseFirst = ClipFirst,
- ClipBoxPaintPhaseLast = ClipBoxPaintPhaseFirst + PaintPhaseMax,
- ClipColumnBoundsPaintPhaseFirst,
- ClipColumnBoundsPaintPhaseLast = ClipColumnBoundsPaintPhaseFirst + PaintPhaseMax,
- ClipLayerFragmentPaintPhaseFirst,
- ClipLayerFragmentPaintPhaseLast = ClipLayerFragmentPaintPhaseFirst + PaintPhaseMax,
- ClipFileUploadControlRect,
- ClipFrameToVisibleContentRect,
- ClipFrameScrollbars,
- ClipLayerBackground,
- ClipLayerColumnBounds,
- ClipLayerFilter,
- ClipLayerForeground,
- ClipLayerParent,
- ClipLayerOverflowControls,
- ClipNodeImage,
- ClipPopupListBoxFrame,
- ClipScrollbarsToBoxBounds,
- ClipSelectionImage,
- PageWidgetDelegateClip,
- ClipPrintedPage,
- ClipLast = ClipPrintedPage,
-
- EndClipFirst,
- EndClipLast = EndClipFirst + ClipLast - ClipFirst,
-
- FloatClipFirst,
- FloatClipPaintPhaseFirst = FloatClipFirst,
- FloatClipPaintPhaseLast = FloatClipFirst + PaintPhaseMax,
- FloatClipLast = FloatClipPaintPhaseLast,
- EndFloatClipFirst,
- EndFloatClipLast = EndFloatClipFirst + FloatClipLast - FloatClipFirst,
-
- ScrollFirst,
- ScrollPaintPhaseFirst = ScrollFirst,
- ScrollPaintPhaseLast = ScrollPaintPhaseFirst + PaintPhaseMax,
- ScrollOverflowControls,
- ScrollLast = ScrollOverflowControls,
- EndScrollFirst,
- EndScrollLast = EndScrollFirst + ScrollLast - ScrollFirst,
-
- Transform3DFirst,
- Transform3DElementTransform = Transform3DFirst,
- Transform3DLast = Transform3DElementTransform,
- EndTransform3DFirst,
- EndTransform3DLast = EndTransform3DFirst + Transform3DLast - Transform3DFirst,
-
- BeginFilter,
- EndFilter,
- BeginCompositing,
- EndCompositing,
- BeginTransform,
- EndTransform,
- BeginClipPath,
- EndClipPath,
-
- Subsequence,
- EndSubsequence,
-
- UninitializedType,
- TypeLast = UninitializedType
+ kTableCollapsedBorderUnalignedBase,
+ kTableCollapsedBorderBase = (((kTableCollapsedBorderUnalignedBase - 1) >> 4) + 1) << 4,
+ kTableCollapsedBorderLast = kTableCollapsedBorderBase + 0x0f,
+ kTableSectionBoxShadowInset,
+ kTableSectionBoxShadowNormal,
+ kTableRowBoxShadowInset,
+ kTableRowBoxShadowNormal,
+ kVideoBitmap,
+ kWebPlugin,
+ kWebFont,
+ kReflectionMask,
+ kDrawingLast = kReflectionMask,
+
+ kForeignLayerFirst,
+ kForeignLayerCanvas = kForeignLayerFirst,
+ kForeignLayerPlugin,
+ kForeignLayerVideo,
+ kForeignLayerLast = kForeignLayerVideo,
+
+ kClipFirst,
+ kClipBoxPaintPhaseFirst = kClipFirst,
+ kClipBoxPaintPhaseLast = kClipBoxPaintPhaseFirst + kPaintPhaseMax,
+ kClipColumnBoundsPaintPhaseFirst,
+ kClipColumnBoundsPaintPhaseLast = kClipColumnBoundsPaintPhaseFirst + kPaintPhaseMax,
+ kClipLayerFragmentPaintPhaseFirst,
+ kClipLayerFragmentPaintPhaseLast = kClipLayerFragmentPaintPhaseFirst + kPaintPhaseMax,
+ kClipFileUploadControlRect,
+ kClipFrameToVisibleContentRect,
+ kClipFrameScrollbars,
+ kClipLayerBackground,
+ kClipLayerColumnBounds,
+ kClipLayerFilter,
+ kClipLayerForeground,
+ kClipLayerParent,
+ kClipLayerOverflowControls,
+ kClipNodeImage,
+ kClipPopupListBoxFrame,
+ kClipScrollbarsToBoxBounds,
+ kClipSelectionImage,
+ kPageWidgetDelegateClip,
+ kClipPrintedPage,
+ kClipLast = kClipPrintedPage,
+
+ kEndClipFirst,
+ kEndClipLast = kEndClipFirst + kClipLast - kClipFirst,
+
+ kFloatClipFirst,
+ kFloatClipPaintPhaseFirst = kFloatClipFirst,
+ kFloatClipPaintPhaseLast = kFloatClipFirst + kPaintPhaseMax,
+ kFloatClipLast = kFloatClipPaintPhaseLast,
+ kEndFloatClipFirst,
+ kEndFloatClipLast = kEndFloatClipFirst + kFloatClipLast - kFloatClipFirst,
+
+ kScrollFirst,
+ kScrollPaintPhaseFirst = kScrollFirst,
+ kScrollPaintPhaseLast = kScrollPaintPhaseFirst + kPaintPhaseMax,
+ kScrollOverflowControls,
+ kScrollLast = kScrollOverflowControls,
+ kEndScrollFirst,
+ kEndScrollLast = kEndScrollFirst + kScrollLast - kScrollFirst,
+
+ kTransform3DFirst,
+ kTransform3DElementTransform = kTransform3DFirst,
+ kTransform3DLast = kTransform3DElementTransform,
+ kEndTransform3DFirst,
+ kEndTransform3DLast = kEndTransform3DFirst + kTransform3DLast - kTransform3DFirst,
+
+ kBeginFilter,
+ kEndFilter,
+ kBeginCompositing,
+ kEndCompositing,
+ kBeginTransform,
+ kEndTransform,
+ kBeginClipPath,
+ kEndClipPath,
+
+ kSubsequence,
+ kEndSubsequence,
+
+ kUninitializedType,
+ kTypeLast = kUninitializedType
};
- static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase, "TableCollapsedBorder types overlap with other types");
- static_assert((TableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of TableCollapsedBorderBase should be zero");
+ static_assert(kTableCollapsedBorderBase >= kTableCollapsedBorderUnalignedBase, "TableCollapsedBorder types overlap with other types");
+ static_assert((kTableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of TableCollapsedBorderBase should be zero");
// Bits or'ed onto TableCollapsedBorderBase to generate a real table collapsed border type.
enum TableCollapsedBorderSides {
TableCollapsedBorderTop = 1 << 0,
@@ -247,21 +247,21 @@ public:
// See comments of enum Type for usage of the following macros.
#define DEFINE_CATEGORY_METHODS(Category) \
- static bool is##Category##Type(Type type) { return type >= Category##First && type <= Category##Last; } \
+ static bool is##Category##Type(Type type) { return type >= k##Category##First && type <= k##Category##Last; } \
bool is##Category() const { return is##Category##Type(getType()); }
#define DEFINE_CONVERSION_METHODS(Category1, category1, Category2, category2) \
static Type category1##TypeTo##Category2##Type(Type type) \
{ \
- static_assert(Category1##Last - Category1##First == Category2##Last - Category2##First, \
+ static_assert(k##Category1##Last - k##Category1##First == k##Category2##Last - k##Category2##First, \
"Categories " #Category1 " and " #Category2 " should have same number of enum values. See comments of DisplayItem::Type"); \
ASSERT(is##Category1##Type(type)); \
- return static_cast<Type>(type - Category1##First + Category2##First); \
+ return static_cast<Type>(type - k##Category1##First + k##Category2##First); \
} \
static Type category2##TypeTo##Category1##Type(Type type) \
{ \
ASSERT(is##Category2##Type(type)); \
- return static_cast<Type>(type - Category2##First + Category1##First); \
+ return static_cast<Type>(type - k##Category2##First + k##Category1##First); \
}
#define DEFINE_PAIRED_CATEGORY_METHODS(Category, category) \
@@ -272,9 +272,9 @@ public:
#define DEFINE_PAINT_PHASE_CONVERSION_METHOD(Category) \
static Type paintPhaseTo##Category##Type(int paintPhase) \
{ \
- static_assert(Category##PaintPhaseLast - Category##PaintPhaseFirst == PaintPhaseMax, \
+ static_assert(k##Category##PaintPhaseLast - k##Category##PaintPhaseFirst == k##PaintPhaseMax, \
"Invalid paint-phase-based category " #Category ". See comments of DisplayItem::Type"); \
- return static_cast<Type>(paintPhase + Category##PaintPhaseFirst); \
+ return static_cast<Type>(paintPhase + k##Category##PaintPhaseFirst); \
}
DEFINE_CATEGORY_METHODS(Drawing)
@@ -295,7 +295,7 @@ public:
DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D)
- static bool isCacheableType(Type type) { return isDrawingType(type) || type == Subsequence; }
+ static bool isCacheableType(Type type) { return isDrawingType(type) || type == kSubsequence; }
bool isCacheable() const { return !skippedCache() && isCacheableType(m_type); }
virtual bool isBegin() const { return false; }
@@ -339,13 +339,13 @@ private:
DisplayItem()
: m_client(nullptr)
- , m_type(UninitializedType)
+ , m_type(kUninitializedType)
, m_derivedSize(sizeof(*this))
, m_skippedCache(false)
{ }
const DisplayItemClient* m_client;
- static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits");
+ static_assert(kTypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits");
const Type m_type : 16;
const unsigned m_derivedSize : 8; // size of the actual derived class
unsigned m_skippedCache : 1;

Powered by Google App Engine
This is Rietveld 408576698