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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 EndCompositing, | 157 EndCompositing, |
158 BeginTransform, | 158 BeginTransform, |
159 EndTransform, | 159 EndTransform, |
160 BeginClipPath, | 160 BeginClipPath, |
161 EndClipPath, | 161 EndClipPath, |
162 BeginFixedPosition, | 162 BeginFixedPosition, |
163 EndFixedPosition, | 163 EndFixedPosition, |
164 BeginFixedPositionContainer, | 164 BeginFixedPositionContainer, |
165 EndFixedPositionContainer, | 165 EndFixedPositionContainer, |
166 | 166 |
167 CachedSubtreeFirst, | 167 BeginSubsequence, |
168 CachedSubtreePaintPhaseFirst = CachedSubtreeFirst, | 168 EndSubsequence, |
169 CachedSubtreePaintPhaseLast = CachedSubtreePaintPhaseFirst + PaintPhaseM
ax, | 169 CachedSubsequence, |
170 CachedSubtreeLast = CachedSubtreePaintPhaseLast, | |
171 | |
172 BeginSubtreeFirst, | |
173 BeginSubtreePaintPhaseFirst = BeginSubtreeFirst, | |
174 BeginSubtreePaintPhaseLast = BeginSubtreePaintPhaseFirst + PaintPhaseMax
, | |
175 BeginSubtreeLast = BeginSubtreePaintPhaseLast, | |
176 | |
177 EndSubtreeFirst, | |
178 EndSubtreePaintPhaseFirst = EndSubtreeFirst, | |
179 EndSubtreePaintPhaseLast = EndSubtreePaintPhaseFirst + PaintPhaseMax, | |
180 EndSubtreeLast = EndSubtreePaintPhaseLast, | |
181 | 170 |
182 UninitializedType, | 171 UninitializedType, |
183 TypeLast = UninitializedType | 172 TypeLast = UninitializedType |
184 }; | 173 }; |
185 | 174 |
186 static_assert(TableCollapsedBorderBase >= TableCollapsedBorderUnalignedBase,
"TableCollapsedBorder types overlap with other types"); | 175 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"); | 176 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. | 177 // Bits or'ed onto TableCollapsedBorderBase to generate a real table collaps
ed border type. |
189 enum TableCollspaedBorderSides { | 178 enum TableCollspaedBorderSides { |
190 TableCollapsedBorderTop = 1 << 0, | 179 TableCollapsedBorderTop = 1 << 0, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 const DisplayItemClient client; | 220 const DisplayItemClient client; |
232 const Type type; | 221 const Type type; |
233 const unsigned scope; | 222 const unsigned scope; |
234 }; | 223 }; |
235 | 224 |
236 // Convert cached type to non-cached type (e.g., Type::CachedSVGImage -> Typ
e::SVGImage). | 225 // Convert cached type to non-cached type (e.g., Type::CachedSVGImage -> Typ
e::SVGImage). |
237 static Type nonCachedType(Type type) | 226 static Type nonCachedType(Type type) |
238 { | 227 { |
239 if (isCachedDrawingType(type)) | 228 if (isCachedDrawingType(type)) |
240 return cachedDrawingTypeToDrawingType(type); | 229 return cachedDrawingTypeToDrawingType(type); |
241 if (isCachedSubtreeType(type)) | 230 if (type == CachedSubsequence) |
242 return cachedSubtreeTypeToBeginSubtreeType(type); | 231 return BeginSubsequence; |
243 return type; | 232 return type; |
244 } | 233 } |
245 | 234 |
246 // Return the Id with cached type converted to non-cached type. | 235 // Return the Id with cached type converted to non-cached type. |
247 Id nonCachedId() const | 236 Id nonCachedId() const |
248 { | 237 { |
249 return Id(m_client, nonCachedType(m_type), m_scope); | 238 return Id(m_client, nonCachedType(m_type), m_scope); |
250 } | 239 } |
251 | 240 |
252 virtual void replay(GraphicsContext&) { } | 241 virtual void replay(GraphicsContext&) { } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) | 301 DEFINE_PAINT_PHASE_CONVERSION_METHOD(ClipColumnBounds) |
313 | 302 |
314 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) | 303 DEFINE_PAIRED_CATEGORY_METHODS(FloatClip, floatClip) |
315 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) | 304 DEFINE_PAINT_PHASE_CONVERSION_METHOD(FloatClip) |
316 | 305 |
317 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) | 306 DEFINE_PAIRED_CATEGORY_METHODS(Scroll, scroll) |
318 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) | 307 DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll) |
319 | 308 |
320 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D); | 309 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D); |
321 | 310 |
322 DEFINE_CATEGORY_METHODS(CachedSubtree) | 311 static bool isCachedType(Type type) { return isCachedDrawingType(type) || ty
pe == CachedSubsequence; } |
323 DEFINE_PAINT_PHASE_CONVERSION_METHOD(CachedSubtree) | |
324 DEFINE_CATEGORY_METHODS(BeginSubtree) | |
325 DEFINE_PAINT_PHASE_CONVERSION_METHOD(BeginSubtree) | |
326 DEFINE_CATEGORY_METHODS(EndSubtree) | |
327 DEFINE_PAINT_PHASE_CONVERSION_METHOD(EndSubtree) | |
328 DEFINE_CONVERSION_METHODS(CachedSubtree, cachedSubtree, BeginSubtree, beginS
ubtree) | |
329 DEFINE_CONVERSION_METHODS(CachedSubtree, cachedSubtree, EndSubtree, endSubtr
ee) | |
330 DEFINE_CONVERSION_METHODS(BeginSubtree, beginSubtree, EndSubtree, endSubtree
) | |
331 | |
332 static bool isCachedType(Type type) { return isCachedDrawingType(type) || is
CachedSubtreeType(type); } | |
333 bool isCached() const { return isCachedType(m_type); } | 312 bool isCached() const { return isCachedType(m_type); } |
334 static bool isCacheableType(Type type) { return isDrawingType(type) || isBeg
inSubtreeType(type); } | 313 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== BeginSubsequence; } |
335 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } | 314 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } |
336 | 315 |
337 virtual bool isBegin() const { return false; } | 316 virtual bool isBegin() const { return false; } |
338 virtual bool isEnd() const { return false; } | 317 virtual bool isEnd() const { return false; } |
339 | 318 |
340 #if ENABLE(ASSERT) | 319 #if ENABLE(ASSERT) |
341 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } | 320 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } |
342 #endif | 321 #endif |
343 | 322 |
344 virtual bool drawsContent() const { return false; } | 323 virtual bool drawsContent() const { return false; } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 377 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
399 #endif | 378 #endif |
400 | 379 |
401 private: | 380 private: |
402 bool isEnd() const final { return true; } | 381 bool isEnd() const final { return true; } |
403 }; | 382 }; |
404 | 383 |
405 } // namespace blink | 384 } // namespace blink |
406 | 385 |
407 #endif // DisplayItem_h | 386 #endif // DisplayItem_h |
OLD | NEW |