| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 EndCompositing, | 158 EndCompositing, |
| 159 BeginTransform, | 159 BeginTransform, |
| 160 EndTransform, | 160 EndTransform, |
| 161 BeginClipPath, | 161 BeginClipPath, |
| 162 EndClipPath, | 162 EndClipPath, |
| 163 BeginFixedPosition, | 163 BeginFixedPosition, |
| 164 EndFixedPosition, | 164 EndFixedPosition, |
| 165 BeginFixedPositionContainer, | 165 BeginFixedPositionContainer, |
| 166 EndFixedPositionContainer, | 166 EndFixedPositionContainer, |
| 167 | 167 |
| 168 BeginSubsequence, | 168 SubsequenceFirst, |
| 169 EndSubsequence, | 169 SubsequenceNegativeZOrder = SubsequenceFirst, |
| 170 CachedSubsequence, | 170 SubsequenceNormalFlowAndPositiveZOrder, |
| 171 SubsequenceLast = SubsequenceNormalFlowAndPositiveZOrder, |
| 172 EndSubsequenceFirst, |
| 173 EndSubsequenceLast = EndSubsequenceFirst + SubsequenceLast - Subsequence
First, |
| 174 CachedSubsequenceFirst, |
| 175 CachedSubsequenceLast = CachedSubsequenceFirst + SubsequenceLast - Subse
quenceFirst, |
| 171 | 176 |
| 172 UninitializedType, | 177 UninitializedType, |
| 173 TypeLast = UninitializedType | 178 TypeLast = UninitializedType |
| 174 }; | 179 }; |
| 175 | 180 |
| 176 static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase,
"TableCollapsedBorder types overlap with other types"); | 181 static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase,
"TableCollapsedBorder types overlap with other types"); |
| 177 static_assert((TableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of T
ableCollapsedBorderBase should be zero"); | 182 static_assert((TableCollapsedBorderBase & 0xf) == 0, "The lowest 4 bits of T
ableCollapsedBorderBase should be zero"); |
| 178 // Bits or'ed onto TableCollapsedBorderBase to generate a real table collaps
ed border type. | 183 // Bits or'ed onto TableCollapsedBorderBase to generate a real table collaps
ed border type. |
| 179 enum TableCollspaedBorderSides { | 184 enum TableCollspaedBorderSides { |
| 180 TableCollapsedBorderTop = 1 << 0, | 185 TableCollapsedBorderTop = 1 << 0, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 const DisplayItemClient client; | 226 const DisplayItemClient client; |
| 222 const Type type; | 227 const Type type; |
| 223 const unsigned scope; | 228 const unsigned scope; |
| 224 }; | 229 }; |
| 225 | 230 |
| 226 // Convert cached type to non-cached type (e.g., Type::CachedSVGImage -> Typ
e::SVGImage). | 231 // Convert cached type to non-cached type (e.g., Type::CachedSVGImage -> Typ
e::SVGImage). |
| 227 static Type nonCachedType(Type type) | 232 static Type nonCachedType(Type type) |
| 228 { | 233 { |
| 229 if (isCachedDrawingType(type)) | 234 if (isCachedDrawingType(type)) |
| 230 return cachedDrawingTypeToDrawingType(type); | 235 return cachedDrawingTypeToDrawingType(type); |
| 231 if (type == CachedSubsequence) | 236 if (isCachedSubsequenceType(type)) |
| 232 return BeginSubsequence; | 237 return cachedSubsequenceTypeToSubsequenceType(type); |
| 233 return type; | 238 return type; |
| 234 } | 239 } |
| 235 | 240 |
| 236 // Return the Id with cached type converted to non-cached type. | 241 // Return the Id with cached type converted to non-cached type. |
| 237 Id nonCachedId() const | 242 Id nonCachedId() const |
| 238 { | 243 { |
| 239 return Id(m_client, nonCachedType(m_type), m_scope); | 244 return Id(m_client, nonCachedType(m_type), m_scope); |
| 240 } | 245 } |
| 241 | 246 |
| 242 virtual void replay(GraphicsContext&) { } | 247 virtual void replay(GraphicsContext&) { } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment) | 305 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipLayerFragment) |
| 301 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox) | 306 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipBox) |
| 302 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) | 307 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) |
| 303 | 308 |
| 304 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) | 309 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) |
| 305 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) | 310 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) |
| 306 | 311 |
| 307 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) | 312 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) |
| 308 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) | 313 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) |
| 309 | 314 |
| 310 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D); | 315 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) |
| 311 | 316 |
| 312 static bool isCachedType(Type type) { return isCachedDrawingType(type) || ty
pe == CachedSubsequence; } | 317 DEFINE_PAIRED_CATEGORY_METHODS(Subsequence, subsequence) |
| 318 DEFINE_CATEGORY_METHODS(CachedSubsequence) |
| 319 DEFINE_CONVERSION_METHODS(Subsequence, subsequence, CachedSubsequence, cache
dSubsequence) |
| 320 |
| 321 static bool isCachedType(Type type) { return isCachedDrawingType(type) || is
CachedSubsequenceType(type); } |
| 313 bool isCached() const { return isCachedType(m_type); } | 322 bool isCached() const { return isCachedType(m_type); } |
| 314 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== BeginSubsequence; } | 323 static bool isCacheableType(Type type) { return isDrawingType(type) || isSub
sequenceType(type); } |
| 315 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } | 324 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } |
| 316 | 325 |
| 317 virtual bool isBegin() const { return false; } | 326 virtual bool isBegin() const { return false; } |
| 318 virtual bool isEnd() const { return false; } | 327 virtual bool isEnd() const { return false; } |
| 319 | 328 |
| 320 #if ENABLE(ASSERT) | 329 #if ENABLE(ASSERT) |
| 321 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } | 330 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } |
| 322 virtual bool equals(const DisplayItem& other) const | 331 virtual bool equals(const DisplayItem& other) const |
| 323 { | 332 { |
| 324 return m_client == other.m_client | 333 return m_client == other.m_client |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 392 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 384 #endif | 393 #endif |
| 385 | 394 |
| 386 private: | 395 private: |
| 387 bool isEnd() const final { return true; } | 396 bool isEnd() const final { return true; } |
| 388 }; | 397 }; |
| 389 | 398 |
| 390 } // namespace blink | 399 } // namespace blink |
| 391 | 400 |
| 392 #endif // DisplayItem_h | 401 #endif // DisplayItem_h |
| OLD | NEW |