| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 EndCompositing, | 161 EndCompositing, |
| 162 BeginTransform, | 162 BeginTransform, |
| 163 EndTransform, | 163 EndTransform, |
| 164 BeginClipPath, | 164 BeginClipPath, |
| 165 EndClipPath, | 165 EndClipPath, |
| 166 BeginFixedPosition, | 166 BeginFixedPosition, |
| 167 EndFixedPosition, | 167 EndFixedPosition, |
| 168 BeginFixedPositionContainer, | 168 BeginFixedPositionContainer, |
| 169 EndFixedPositionContainer, | 169 EndFixedPositionContainer, |
| 170 | 170 |
| 171 SubsequenceFirst, | 171 Subsequence, |
| 172 SubsequenceNegativeZOrder = SubsequenceFirst, | 172 EndSubsequence, |
| 173 SubsequenceNormalFlowAndPositiveZOrder, | 173 CachedSubsequence, |
| 174 SubsequenceLast = SubsequenceNormalFlowAndPositiveZOrder, | |
| 175 EndSubsequenceFirst, | |
| 176 EndSubsequenceLast = EndSubsequenceFirst + SubsequenceLast - Subsequence
First, | |
| 177 CachedSubsequenceFirst, | |
| 178 CachedSubsequenceLast = CachedSubsequenceFirst + SubsequenceLast - Subse
quenceFirst, | |
| 179 | 174 |
| 180 CachedDisplayItemList, | 175 CachedDisplayItemList, |
| 181 | 176 |
| 182 UninitializedType, | 177 UninitializedType, |
| 183 TypeLast = UninitializedType | 178 TypeLast = UninitializedType |
| 184 }; | 179 }; |
| 185 | 180 |
| 186 static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase,
"TableCollapsedBorder types overlap with other types"); | 181 static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase,
"TableCollapsedBorder types overlap with other types"); |
| 187 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"); |
| 188 // 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. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 const DisplayItemClient client; | 226 const DisplayItemClient client; |
| 232 const Type type; | 227 const Type type; |
| 233 const unsigned scope; | 228 const unsigned scope; |
| 234 }; | 229 }; |
| 235 | 230 |
| 236 // 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). |
| 237 static Type nonCachedType(Type type) | 232 static Type nonCachedType(Type type) |
| 238 { | 233 { |
| 239 if (isCachedDrawingType(type)) | 234 if (isCachedDrawingType(type)) |
| 240 return cachedDrawingTypeToDrawingType(type); | 235 return cachedDrawingTypeToDrawingType(type); |
| 241 if (isCachedSubsequenceType(type)) | 236 if (type == CachedSubsequence) |
| 242 return cachedSubsequenceTypeToSubsequenceType(type); | 237 return Subsequence; |
| 243 return type; | 238 return type; |
| 244 } | 239 } |
| 245 | 240 |
| 246 // Return the Id with cached type converted to non-cached type. | 241 // Return the Id with cached type converted to non-cached type. |
| 247 Id nonCachedId() const | 242 Id nonCachedId() const |
| 248 { | 243 { |
| 249 return Id(m_client, nonCachedType(m_type), m_scope); | 244 return Id(m_client, nonCachedType(m_type), m_scope); |
| 250 } | 245 } |
| 251 | 246 |
| 252 virtual void replay(GraphicsContext&) const { } | 247 virtual void replay(GraphicsContext&) const { } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) | 307 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) |
| 313 | 308 |
| 314 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) | 309 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) |
| 315 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) | 310 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) |
| 316 | 311 |
| 317 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) | 312 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) |
| 318 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) | 313 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) |
| 319 | 314 |
| 320 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) | 315 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) |
| 321 | 316 |
| 322 DEFINE_PAIRED_CATEGORY_METHODS(Subsequence, subsequence) | 317 static bool isCachedType(Type type) { return isCachedDrawingType(type) || ty
pe == CachedSubsequence || type == CachedDisplayItemList; } |
| 323 DEFINE_CATEGORY_METHODS(CachedSubsequence) | |
| 324 DEFINE_CONVERSION_METHODS(Subsequence, subsequence, CachedSubsequence, cache
dSubsequence) | |
| 325 | |
| 326 static bool isCachedType(Type type) { return isCachedDrawingType(type) || is
CachedSubsequenceType(type) || type == CachedDisplayItemList; } | |
| 327 bool isCached() const { return isCachedType(m_type); } | 318 bool isCached() const { return isCachedType(m_type); } |
| 328 static bool isCacheableType(Type type) { return isDrawingType(type) || isSub
sequenceType(type); } | 319 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== Subsequence; } |
| 329 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } | 320 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } |
| 330 | 321 |
| 331 virtual bool isBegin() const { return false; } | 322 virtual bool isBegin() const { return false; } |
| 332 virtual bool isEnd() const { return false; } | 323 virtual bool isEnd() const { return false; } |
| 333 | 324 |
| 334 #if ENABLE(ASSERT) | 325 #if ENABLE(ASSERT) |
| 335 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } | 326 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } |
| 336 virtual bool equals(const DisplayItem& other) const | 327 virtual bool equals(const DisplayItem& other) const |
| 337 { | 328 { |
| 338 return m_client == other.m_client | 329 return m_client == other.m_client |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 388 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 398 #endif | 389 #endif |
| 399 | 390 |
| 400 private: | 391 private: |
| 401 bool isEnd() const final { return true; } | 392 bool isEnd() const final { return true; } |
| 402 }; | 393 }; |
| 403 | 394 |
| 404 } // namespace blink | 395 } // namespace blink |
| 405 | 396 |
| 406 #endif // DisplayItem_h | 397 #endif // DisplayItem_h |
| OLD | NEW |