| 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 DisplayItemList_h | 5 #ifndef DisplayItemList_h |
| 6 #define DisplayItemList_h | 6 #define DisplayItemList_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace blink { | 24 namespace blink { |
| 25 | 25 |
| 26 class GraphicsLayer; | 26 class GraphicsLayer; |
| 27 class GraphicsContext; | 27 class GraphicsContext; |
| 28 | 28 |
| 29 // kDisplayItemAlignment must be a multiple of alignof(derived display item) for | 29 // kDisplayItemAlignment must be a multiple of alignof(derived display item) for |
| 30 // each derived display item; the ideal value is the least common multiple. | 30 // each derived display item; the ideal value is the least common multiple. |
| 31 // Currently the limiting factor is TransformtionMatrix (in | 31 // Currently the limiting factor is TransformtionMatrix (in |
| 32 // BeginTransform3DDisplayItem), which requests 16-byte alignment. | 32 // BeginTransform3DDisplayItem), which requests 16-byte alignment. |
| 33 static const size_t kDisplayItemAlignment = WTF_ALIGN_OF(BeginTransform3DDisplay
Item); | 33 static const size_t kDisplayItemAlignment = WTF_ALIGN_OF(BeginTransform3DDisplay
Item); |
| 34 static const size_t kInitialDisplayItemsCapacity = 64; | |
| 35 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); | 34 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); |
| 35 static const size_t kTypicalDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); |
| 36 // 16 "typically sized items" is the same as this many large items: |
| 37 static const size_t kInitialDisplayItemsCapacity = 8 * kTypicalDisplayItemSize /
kMaximumDisplayItemSize + 1; |
| 36 | 38 |
| 37 class DisplayItems : public ContiguousContainer<DisplayItem, kDisplayItemAlignme
nt> { | 39 class DisplayItems : public ContiguousContainer<DisplayItem, kDisplayItemAlignme
nt> { |
| 38 public: | 40 public: |
| 39 DisplayItems(size_t initialSizeBytes) | 41 DisplayItems(size_t initialSizeBytes) |
| 40 : ContiguousContainer(kMaximumDisplayItemSize, initialSizeBytes) {} | 42 : ContiguousContainer(kMaximumDisplayItemSize, initialSizeBytes) {} |
| 41 | 43 |
| 42 DisplayItem& appendByMoving(DisplayItem& item) | 44 DisplayItem& appendByMoving(DisplayItem& item) |
| 43 { | 45 { |
| 44 #ifndef NDEBUG | 46 #ifndef NDEBUG |
| 45 WTF::String originalDebugString = item.asDebugString(); | 47 WTF::String originalDebugString = item.asDebugString(); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // the duplicated ids are from. | 253 // the duplicated ids are from. |
| 252 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; | 254 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; |
| 253 #endif | 255 #endif |
| 254 | 256 |
| 255 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; | 257 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; |
| 256 }; | 258 }; |
| 257 | 259 |
| 258 } // namespace blink | 260 } // namespace blink |
| 259 | 261 |
| 260 #endif // DisplayItemList_h | 262 #endif // DisplayItemList_h |
| OLD | NEW |