| 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 #ifndef DisplayItem_h | 5 #ifndef DisplayItem_h |
| 6 #define DisplayItem_h | 6 #define DisplayItem_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/graphics/ContiguousContainer.h" | 9 #include "platform/graphics/ContiguousContainer.h" |
| 10 #include "platform/graphics/paint/DisplayItemClient.h" | 10 #include "platform/graphics/paint/DisplayItemClient.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class GraphicsContext; | 24 class GraphicsContext; |
| 25 class IntRect; | 25 class IntRect; |
| 26 class WebDisplayItemList; | 26 class WebDisplayItemList; |
| 27 | 27 |
| 28 class PLATFORM_EXPORT DisplayItem { | 28 class PLATFORM_EXPORT DisplayItem { |
| 29 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 29 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 30 public: | 30 public: |
| 31 enum { | 31 enum { |
| 32 // Must be kept in sync with core/paint/PaintPhase.h. | 32 // Must be kept in sync with core/paint/PaintPhase.h. |
| 33 PaintPhaseMax = 11, | 33 kPaintPhaseMax = 11, |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // A display item type uniquely identifies a display item of a client. | 36 // A display item type uniquely identifies a display item of a client. |
| 37 // Some display item types can be categorized using the following directives
: | 37 // Some display item types can be categorized using the following directives
: |
| 38 // - In enum Type: | 38 // - In enum Type: |
| 39 // - enum value <Category>First; | 39 // - enum value <Category>First; |
| 40 // - enum values of the category, first of which should equal <Category>Fi
rst; | 40 // - enum values of the category, first of which should equal <Category>Fi
rst; |
| 41 // (for ease of maintenance, the values should be in alphabetic order) | 41 // (for ease of maintenance, the values should be in alphabetic order) |
| 42 // - enum value <Category>Last which should be equal to the last of the en
um values of the category | 42 // - enum value <Category>Last which should be equal to the last of the en
um values of the category |
| 43 // - DEFINE_CATEGORY_METHODS(<Category>) to define is<Category>Type(Type) an
d is<Category>() methods. | 43 // - DEFINE_CATEGORY_METHODS(<Category>) to define is<Category>Type(Type) an
d is<Category>() methods. |
| 44 // | 44 // |
| 45 // A category or subset of a category can contain types each of which corres
ponds to a PaintPhase: | 45 // A category or subset of a category can contain types each of which corres
ponds to a PaintPhase: |
| 46 // - In enum Type: | 46 // - In enum Type: |
| 47 // - enum value <Category>[<Subset>]PaintPhaseFirst; | 47 // - enum value <Category>[<Subset>]PaintPhaseFirst; |
| 48 // - enum value <Category>[<Subset>]PaintPhaseLast = <Category>[<Subset>]P
aintPhaseFirst + PaintPhaseMax; | 48 // - enum value <Category>[<Subset>]PaintPhaseLast = <Category>[<Subset>]P
aintPhaseFirst + PaintPhaseMax; |
| 49 // - DEFINE_PAINT_PHASE_CONVERSION_METHOD(<Category>[<Subset>]) to define | 49 // - DEFINE_PAINT_PHASE_CONVERSION_METHOD(<Category>[<Subset>]) to define |
| 50 // paintPhaseTo<Category>[<Subset>]Type(PaintPhase) method. | 50 // paintPhaseTo<Category>[<Subset>]Type(PaintPhase) method. |
| 51 // | 51 // |
| 52 // A category can be derived from another category, containing types each of
which corresponds to a | 52 // A category can be derived from another category, containing types each of
which corresponds to a |
| 53 // value of the latter category: | 53 // value of the latter category: |
| 54 // - In enum Type: | 54 // - In enum Type: |
| 55 // - enum value <Category>First; | 55 // - enum value <Category>First; |
| 56 // - enum value <Category>Last = <Category>First + <BaseCategory>Last - <B
aseCategory>First; | 56 // - enum value <Category>Last = <Category>First + <BaseCategory>Last - <B
aseCategory>First; |
| 57 // - DEFINE_CONVERSION_METHODS(<Category>, <category>, <BaseCategory>, <base
Category>) to define methods to | 57 // - DEFINE_CONVERSION_METHODS(<Category>, <category>, <BaseCategory>, <base
Category>) to define methods to |
| 58 // convert types between the categories; | 58 // convert types between the categories; |
| 59 enum Type { | 59 enum Type { |
| 60 DrawingFirst, | 60 kDrawingFirst, |
| 61 DrawingPaintPhaseFirst = DrawingFirst, | 61 kDrawingPaintPhaseFirst = kDrawingFirst, |
| 62 DrawingPaintPhaseLast = DrawingFirst + PaintPhaseMax, | 62 kDrawingPaintPhaseLast = kDrawingFirst + kPaintPhaseMax, |
| 63 BoxDecorationBackground, | 63 kBoxDecorationBackground, |
| 64 Caret, | 64 kCaret, |
| 65 ColumnRules, | 65 kColumnRules, |
| 66 DebugDrawing, | 66 kDebugDrawing, |
| 67 DocumentBackground, | 67 kDocumentBackground, |
| 68 DragImage, | 68 kDragImage, |
| 69 DragCaret, | 69 kDragCaret, |
| 70 SVGImage, | 70 kSVGImage, |
| 71 LinkHighlight, | 71 kLinkHighlight, |
| 72 ImageAreaFocusRing, | 72 kImageAreaFocusRing, |
| 73 PageOverlay, | 73 kPageOverlay, |
| 74 PageWidgetDelegateBackgroundFallback, | 74 kPageWidgetDelegateBackgroundFallback, |
| 75 PopupContainerBorder, | 75 kPopupContainerBorder, |
| 76 PopupListBoxBackground, | 76 kPopupListBoxBackground, |
| 77 PopupListBoxRow, | 77 kPopupListBoxRow, |
| 78 PrintedContentBackground, | 78 kPrintedContentBackground, |
| 79 PrintedContentDestinationLocations, | 79 kPrintedContentDestinationLocations, |
| 80 PrintedContentLineBoundary, | 80 kPrintedContentLineBoundary, |
| 81 PrintedContentPDFURLRect, | 81 kPrintedContentPDFURLRect, |
| 82 Resizer, | 82 kResizer, |
| 83 SVGClip, | 83 kSVGClip, |
| 84 SVGFilter, | 84 kSVGFilter, |
| 85 SVGMask, | 85 kSVGMask, |
| 86 ScrollbarBackButtonEnd, | 86 kScrollbarBackButtonEnd, |
| 87 ScrollbarBackButtonStart, | 87 kScrollbarBackButtonStart, |
| 88 ScrollbarBackground, | 88 kScrollbarBackground, |
| 89 ScrollbarBackTrack, | 89 kScrollbarBackTrack, |
| 90 ScrollbarCorner, | 90 kScrollbarCorner, |
| 91 ScrollbarForwardButtonEnd, | 91 kScrollbarForwardButtonEnd, |
| 92 ScrollbarForwardButtonStart, | 92 kScrollbarForwardButtonStart, |
| 93 ScrollbarForwardTrack, | 93 kScrollbarForwardTrack, |
| 94 ScrollbarThumb, | 94 kScrollbarThumb, |
| 95 ScrollbarTickmarks, | 95 kScrollbarTickmarks, |
| 96 ScrollbarTrackBackground, | 96 kScrollbarTrackBackground, |
| 97 ScrollbarCompositedScrollbar, | 97 kScrollbarCompositedScrollbar, |
| 98 SelectionTint, | 98 kSelectionTint, |
| 99 TableCellBackgroundFromColumnGroup, | 99 kTableCellBackgroundFromColumnGroup, |
| 100 TableCellBackgroundFromColumn, | 100 kTableCellBackgroundFromColumn, |
| 101 TableCellBackgroundFromSection, | 101 kTableCellBackgroundFromSection, |
| 102 TableCellBackgroundFromRow, | 102 kTableCellBackgroundFromRow, |
| 103 // Table collapsed borders can be painted together (e.g., left & top) bu
t there are at most 4 phases of collapsed | 103 // Table collapsed borders can be painted together (e.g., left & top) bu
t there are at most 4 phases of collapsed |
| 104 // border painting for a single cell. To disambiguate these phases of co
llapsed border painting, a mask is used. | 104 // border painting for a single cell. To disambiguate these phases of co
llapsed border painting, a mask is used. |
| 105 // TableCollapsedBorderBase can be larger than TableCollapsedBorderUnali
gnedBase to ensure the base lower bits are 0's. | 105 // TableCollapsedBorderBase can be larger than TableCollapsedBorderUnali
gnedBase to ensure the base lower bits are 0's. |
| 106 TableCollapsedBorderUnalignedBase, | 106 kTableCollapsedBorderUnalignedBase, |
| 107 TableCollapsedBorderBase = (((TableCollapsedBorderUnalignedBase - 1) >>
4) + 1) << 4, | 107 kTableCollapsedBorderBase = (((kTableCollapsedBorderUnalignedBase - 1) >
> 4) + 1) << 4, |
| 108 TableCollapsedBorderLast = TableCollapsedBorderBase + 0x0f, | 108 kTableCollapsedBorderLast = kTableCollapsedBorderBase + 0x0f, |
| 109 TableSectionBoxShadowInset, | 109 kTableSectionBoxShadowInset, |
| 110 TableSectionBoxShadowNormal, | 110 kTableSectionBoxShadowNormal, |
| 111 TableRowBoxShadowInset, | 111 kTableRowBoxShadowInset, |
| 112 TableRowBoxShadowNormal, | 112 kTableRowBoxShadowNormal, |
| 113 VideoBitmap, | 113 kVideoBitmap, |
| 114 WebPlugin, | 114 kWebPlugin, |
| 115 WebFont, | 115 kWebFont, |
| 116 ReflectionMask, | 116 kReflectionMask, |
| 117 DrawingLast = ReflectionMask, | 117 kDrawingLast = kReflectionMask, |
| 118 | 118 |
| 119 ForeignLayerFirst, | 119 kForeignLayerFirst, |
| 120 ForeignLayerCanvas = ForeignLayerFirst, | 120 kForeignLayerCanvas = kForeignLayerFirst, |
| 121 ForeignLayerPlugin, | 121 kForeignLayerPlugin, |
| 122 ForeignLayerVideo, | 122 kForeignLayerVideo, |
| 123 ForeignLayerLast = ForeignLayerVideo, | 123 kForeignLayerLast = kForeignLayerVideo, |
| 124 | 124 |
| 125 ClipFirst, | 125 kClipFirst, |
| 126 ClipBoxPaintPhaseFirst = ClipFirst, | 126 kClipBoxPaintPhaseFirst = kClipFirst, |
| 127 ClipBoxPaintPhaseLast = ClipBoxPaintPhaseFirst + PaintPhaseMax, | 127 kClipBoxPaintPhaseLast = kClipBoxPaintPhaseFirst + kPaintPhaseMax, |
| 128 ClipColumnBoundsPaintPhaseFirst, | 128 kClipColumnBoundsPaintPhaseFirst, |
| 129 ClipColumnBoundsPaintPhaseLast = ClipColumnBoundsPaintPhaseFirst + Paint
PhaseMax, | 129 kClipColumnBoundsPaintPhaseLast = kClipColumnBoundsPaintPhaseFirst + kPa
intPhaseMax, |
| 130 ClipLayerFragmentPaintPhaseFirst, | 130 kClipLayerFragmentPaintPhaseFirst, |
| 131 ClipLayerFragmentPaintPhaseLast = ClipLayerFragmentPaintPhaseFirst + Pai
ntPhaseMax, | 131 kClipLayerFragmentPaintPhaseLast = kClipLayerFragmentPaintPhaseFirst + k
PaintPhaseMax, |
| 132 ClipFileUploadControlRect, | 132 kClipFileUploadControlRect, |
| 133 ClipFrameToVisibleContentRect, | 133 kClipFrameToVisibleContentRect, |
| 134 ClipFrameScrollbars, | 134 kClipFrameScrollbars, |
| 135 ClipLayerBackground, | 135 kClipLayerBackground, |
| 136 ClipLayerColumnBounds, | 136 kClipLayerColumnBounds, |
| 137 ClipLayerFilter, | 137 kClipLayerFilter, |
| 138 ClipLayerForeground, | 138 kClipLayerForeground, |
| 139 ClipLayerParent, | 139 kClipLayerParent, |
| 140 ClipLayerOverflowControls, | 140 kClipLayerOverflowControls, |
| 141 ClipNodeImage, | 141 kClipNodeImage, |
| 142 ClipPopupListBoxFrame, | 142 kClipPopupListBoxFrame, |
| 143 ClipScrollbarsToBoxBounds, | 143 kClipScrollbarsToBoxBounds, |
| 144 ClipSelectionImage, | 144 kClipSelectionImage, |
| 145 PageWidgetDelegateClip, | 145 kPageWidgetDelegateClip, |
| 146 ClipPrintedPage, | 146 kClipPrintedPage, |
| 147 ClipLast = ClipPrintedPage, | 147 kClipLast = kClipPrintedPage, |
| 148 | 148 |
| 149 EndClipFirst, | 149 kEndClipFirst, |
| 150 EndClipLast = EndClipFirst + ClipLast - ClipFirst, | 150 kEndClipLast = kEndClipFirst + kClipLast - kClipFirst, |
| 151 | 151 |
| 152 FloatClipFirst, | 152 kFloatClipFirst, |
| 153 FloatClipPaintPhaseFirst = FloatClipFirst, | 153 kFloatClipPaintPhaseFirst = kFloatClipFirst, |
| 154 FloatClipPaintPhaseLast = FloatClipFirst + PaintPhaseMax, | 154 kFloatClipPaintPhaseLast = kFloatClipFirst + kPaintPhaseMax, |
| 155 FloatClipLast = FloatClipPaintPhaseLast, | 155 kFloatClipLast = kFloatClipPaintPhaseLast, |
| 156 EndFloatClipFirst, | 156 kEndFloatClipFirst, |
| 157 EndFloatClipLast = EndFloatClipFirst + FloatClipLast - FloatClipFirst, | 157 kEndFloatClipLast = kEndFloatClipFirst + kFloatClipLast - kFloatClipFirs
t, |
| 158 | 158 |
| 159 ScrollFirst, | 159 kScrollFirst, |
| 160 ScrollPaintPhaseFirst = ScrollFirst, | 160 kScrollPaintPhaseFirst = kScrollFirst, |
| 161 ScrollPaintPhaseLast = ScrollPaintPhaseFirst + PaintPhaseMax, | 161 kScrollPaintPhaseLast = kScrollPaintPhaseFirst + kPaintPhaseMax, |
| 162 ScrollOverflowControls, | 162 kScrollOverflowControls, |
| 163 ScrollLast = ScrollOverflowControls, | 163 kScrollLast = kScrollOverflowControls, |
| 164 EndScrollFirst, | 164 kEndScrollFirst, |
| 165 EndScrollLast = EndScrollFirst + ScrollLast - ScrollFirst, | 165 kEndScrollLast = kEndScrollFirst + kScrollLast - kScrollFirst, |
| 166 | 166 |
| 167 Transform3DFirst, | 167 kTransform3DFirst, |
| 168 Transform3DElementTransform = Transform3DFirst, | 168 kTransform3DElementTransform = kTransform3DFirst, |
| 169 Transform3DLast = Transform3DElementTransform, | 169 kTransform3DLast = kTransform3DElementTransform, |
| 170 EndTransform3DFirst, | 170 kEndTransform3DFirst, |
| 171 EndTransform3DLast = EndTransform3DFirst + Transform3DLast - Transform3D
First, | 171 kEndTransform3DLast = kEndTransform3DFirst + kTransform3DLast - kTransfo
rm3DFirst, |
| 172 | 172 |
| 173 BeginFilter, | 173 kBeginFilter, |
| 174 EndFilter, | 174 kEndFilter, |
| 175 BeginCompositing, | 175 kBeginCompositing, |
| 176 EndCompositing, | 176 kEndCompositing, |
| 177 BeginTransform, | 177 kBeginTransform, |
| 178 EndTransform, | 178 kEndTransform, |
| 179 BeginClipPath, | 179 kBeginClipPath, |
| 180 EndClipPath, | 180 kEndClipPath, |
| 181 | 181 |
| 182 Subsequence, | 182 kSubsequence, |
| 183 EndSubsequence, | 183 kEndSubsequence, |
| 184 | 184 |
| 185 UninitializedType, | 185 kUninitializedType, |
| 186 TypeLast = UninitializedType | 186 kTypeLast = kUninitializedType |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase,
"TableCollapsedBorder types overlap with other types"); | 189 static_assert(kTableCollapsedBorderBase >= kTableCollapsedBorderUnalignedBas
e, "TableCollapsedBorder types overlap with other types"); |
| 190 static_assert((TableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of T
ableCollapsedBorderBase should be zero"); | 190 static_assert((kTableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of
TableCollapsedBorderBase should be zero"); |
| 191 // Bits or'ed onto TableCollapsedBorderBase to generate a real table collaps
ed border type. | 191 // Bits or'ed onto TableCollapsedBorderBase to generate a real table collaps
ed border type. |
| 192 enum TableCollapsedBorderSides { | 192 enum TableCollapsedBorderSides { |
| 193 TableCollapsedBorderTop = 1 << 0, | 193 TableCollapsedBorderTop = 1 << 0, |
| 194 TableCollapsedBorderRight = 1 << 1, | 194 TableCollapsedBorderRight = 1 << 1, |
| 195 TableCollapsedBorderBottom = 1 << 2, | 195 TableCollapsedBorderBottom = 1 << 2, |
| 196 TableCollapsedBorderLeft = 1 << 3, | 196 TableCollapsedBorderLeft = 1 << 3, |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 DisplayItem(const DisplayItemClient& client, Type type, size_t derivedSize) | 199 DisplayItem(const DisplayItemClient& client, Type type, size_t derivedSize) |
| 200 : m_client(&client) | 200 : m_client(&client) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // For PaintController only. Painters should use DisplayItemCacheSkipper ins
tead. | 240 // For PaintController only. Painters should use DisplayItemCacheSkipper ins
tead. |
| 241 void setSkippedCache() { m_skippedCache = true; } | 241 void setSkippedCache() { m_skippedCache = true; } |
| 242 bool skippedCache() const { return m_skippedCache; } | 242 bool skippedCache() const { return m_skippedCache; } |
| 243 | 243 |
| 244 // TODO(wkorman): Only DrawingDisplayItem needs the visual rect argument. | 244 // TODO(wkorman): Only DrawingDisplayItem needs the visual rect argument. |
| 245 // Consider refactoring class hierarchy to make this more explicit. | 245 // Consider refactoring class hierarchy to make this more explicit. |
| 246 virtual void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*)
const { } | 246 virtual void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*)
const { } |
| 247 | 247 |
| 248 // See comments of enum Type for usage of the following macros. | 248 // See comments of enum Type for usage of the following macros. |
| 249 #define DEFINE_CATEGORY_METHODS(Category) \ | 249 #define DEFINE_CATEGORY_METHODS(Category) \ |
| 250 static bool is##Category##Type(Type type) { return type >= Category##First &
& type <= Category##Last; } \ | 250 static bool is##Category##Type(Type type) { return type >= k##Category##Firs
t && type <= k##Category##Last; } \ |
| 251 bool is##Category() const { return is##Category##Type(getType()); } | 251 bool is##Category() const { return is##Category##Type(getType()); } |
| 252 | 252 |
| 253 #define DEFINE_CONVERSION_METHODS(Category1, category1, Category2, category2) \ | 253 #define DEFINE_CONVERSION_METHODS(Category1, category1, Category2, category2) \ |
| 254 static Type category1##TypeTo##Category2##Type(Type type) \ | 254 static Type category1##TypeTo##Category2##Type(Type type) \ |
| 255 { \ | 255 { \ |
| 256 static_assert(Category1##Last - Category1##First == Category2##Last - Ca
tegory2##First, \ | 256 static_assert(k##Category1##Last - k##Category1##First == k##Category2##
Last - k##Category2##First, \ |
| 257 "Categories " #Category1 " and " #Category2 " should have same numbe
r of enum values. See comments of DisplayItem::Type"); \ | 257 "Categories " #Category1 " and " #Category2 " should have same numbe
r of enum values. See comments of DisplayItem::Type"); \ |
| 258 ASSERT(is##Category1##Type(type)); \ | 258 ASSERT(is##Category1##Type(type)); \ |
| 259 return static_cast<Type>(type - Category1##First + Category2##First); \ | 259 return static_cast<Type>(type - k##Category1##First + k##Category2##Firs
t); \ |
| 260 } \ | 260 } \ |
| 261 static Type category2##TypeTo##Category1##Type(Type type) \ | 261 static Type category2##TypeTo##Category1##Type(Type type) \ |
| 262 { \ | 262 { \ |
| 263 ASSERT(is##Category2##Type(type)); \ | 263 ASSERT(is##Category2##Type(type)); \ |
| 264 return static_cast<Type>(type - Category2##First + Category1##First); \ | 264 return static_cast<Type>(type - k##Category2##First + k##Category1##Firs
t); \ |
| 265 } | 265 } |
| 266 | 266 |
| 267 #define DEFINE_PAIRED_CATEGORY_METHODS(Category, category) \ | 267 #define DEFINE_PAIRED_CATEGORY_METHODS(Category, category) \ |
| 268 DEFINE_CATEGORY_METHODS(Category) \ | 268 DEFINE_CATEGORY_METHODS(Category) \ |
| 269 DEFINE_CATEGORY_METHODS(End##Category) \ | 269 DEFINE_CATEGORY_METHODS(End##Category) \ |
| 270 DEFINE_CONVERSION_METHODS(Category, category, End##Category, end##Category) | 270 DEFINE_CONVERSION_METHODS(Category, category, End##Category, end##Category) |
| 271 | 271 |
| 272 #define DEFINE_PAINT_PHASE_CONVERSION_METHOD(Category) \ | 272 #define DEFINE_PAINT_PHASE_CONVERSION_METHOD(Category) \ |
| 273 static Type paintPhaseTo##Category##Type(int paintPhase) \ | 273 static Type paintPhaseTo##Category##Type(int paintPhase) \ |
| 274 { \ | 274 { \ |
| 275 static_assert(Category##PaintPhaseLast - Category##PaintPhaseFirst == Pa
intPhaseMax, \ | 275 static_assert(k##Category##PaintPhaseLast - k##Category##PaintPhaseFirst
== k##PaintPhaseMax, \ |
| 276 "Invalid paint-phase-based category " #Category ". See comments of D
isplayItem::Type"); \ | 276 "Invalid paint-phase-based category " #Category ". See comments of D
isplayItem::Type"); \ |
| 277 return static_cast<Type>(paintPhase + Category##PaintPhaseFirst); \ | 277 return static_cast<Type>(paintPhase + k##Category##PaintPhaseFirst); \ |
| 278 } | 278 } |
| 279 | 279 |
| 280 DEFINE_CATEGORY_METHODS(Drawing) | 280 DEFINE_CATEGORY_METHODS(Drawing) |
| 281 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Drawing) | 281 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Drawing) |
| 282 | 282 |
| 283 DEFINE_CATEGORY_METHODS(ForeignLayer) | 283 DEFINE_CATEGORY_METHODS(ForeignLayer) |
| 284 | 284 |
| 285 DEFINE_PAIRED_CATEGORY_METHODS(Clip, clip) | 285 DEFINE_PAIRED_CATEGORY_METHODS(Clip, clip) |
| 286 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment) | 286 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment) |
| 287 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox) | 287 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox) |
| 288 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) | 288 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) |
| 289 | 289 |
| 290 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) | 290 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) |
| 291 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) | 291 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) |
| 292 | 292 |
| 293 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) | 293 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) |
| 294 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) | 294 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) |
| 295 | 295 |
| 296 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) | 296 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) |
| 297 | 297 |
| 298 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== Subsequence; } | 298 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== kSubsequence; } |
| 299 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } | 299 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } |
| 300 | 300 |
| 301 virtual bool isBegin() const { return false; } | 301 virtual bool isBegin() const { return false; } |
| 302 virtual bool isEnd() const { return false; } | 302 virtual bool isEnd() const { return false; } |
| 303 | 303 |
| 304 #if DCHECK_IS_ON() | 304 #if DCHECK_IS_ON() |
| 305 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } | 305 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } |
| 306 virtual bool equals(const DisplayItem& other) const | 306 virtual bool equals(const DisplayItem& other) const |
| 307 { | 307 { |
| 308 return m_client == other.m_client | 308 return m_client == other.m_client |
| (...skipping 23 matching lines...) Expand all Loading... |
| 332 #endif | 332 #endif |
| 333 | 333 |
| 334 private: | 334 private: |
| 335 // The default DisplayItem constructor is only used by | 335 // The default DisplayItem constructor is only used by |
| 336 // ContiguousContainer::appendByMoving where an invalid DisplaItem is | 336 // ContiguousContainer::appendByMoving where an invalid DisplaItem is |
| 337 // constructed at the source location. | 337 // constructed at the source location. |
| 338 template <typename T, unsigned alignment> friend class ContiguousContainer; | 338 template <typename T, unsigned alignment> friend class ContiguousContainer; |
| 339 | 339 |
| 340 DisplayItem() | 340 DisplayItem() |
| 341 : m_client(nullptr) | 341 : m_client(nullptr) |
| 342 , m_type(UninitializedType) | 342 , m_type(kUninitializedType) |
| 343 , m_derivedSize(sizeof(*this)) | 343 , m_derivedSize(sizeof(*this)) |
| 344 , m_skippedCache(false) | 344 , m_skippedCache(false) |
| 345 { } | 345 { } |
| 346 | 346 |
| 347 const DisplayItemClient* m_client; | 347 const DisplayItemClient* m_client; |
| 348 static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits
"); | 348 static_assert(kTypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bit
s"); |
| 349 const Type m_type : 16; | 349 const Type m_type : 16; |
| 350 const unsigned m_derivedSize : 8; // size of the actual derived class | 350 const unsigned m_derivedSize : 8; // size of the actual derived class |
| 351 unsigned m_skippedCache : 1; | 351 unsigned m_skippedCache : 1; |
| 352 | 352 |
| 353 #ifndef NDEBUG | 353 #ifndef NDEBUG |
| 354 WTF::String m_clientDebugString; | 354 WTF::String m_clientDebugString; |
| 355 #endif | 355 #endif |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 inline bool operator==(const DisplayItem::Id& a, const DisplayItem::Id& b) | 358 inline bool operator==(const DisplayItem::Id& a, const DisplayItem::Id& b) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 381 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 381 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 382 #endif | 382 #endif |
| 383 | 383 |
| 384 private: | 384 private: |
| 385 bool isEnd() const final { return true; } | 385 bool isEnd() const final { return true; } |
| 386 }; | 386 }; |
| 387 | 387 |
| 388 } // namespace blink | 388 } // namespace blink |
| 389 | 389 |
| 390 #endif // DisplayItem_h | 390 #endif // DisplayItem_h |
| OLD | NEW |