| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/graphics/ContiguousContainer.h" | 8 #include "platform/graphics/ContiguousContainer.h" |
| 9 #include "platform/graphics/paint/DisplayItem.h" | 9 #include "platform/graphics/paint/DisplayItem.h" |
| 10 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 10 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
| 11 #include "wtf/Alignment.h" | 11 #include "wtf/Alignment.h" |
| 12 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 13 | 13 |
| 14 class SkPictureGpuAnalyzer; | 14 class SkPictureGpuAnalyzer; |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 struct PaintChunk; | 18 struct PaintChunk; |
| 19 | 19 |
| 20 // kDisplayItemAlignment must be a multiple of alignof(derived display item) for | |
| 21 // each derived display item; the ideal value is the least common multiple. | |
| 22 // Currently the limiting factor is TransformationMatrix (in | |
| 23 // BeginTransform3DDisplayItem), which requests 16-byte alignment. | |
| 24 static const size_t kDisplayItemAlignment = WTF_ALIGN_OF(BeginTransform3DDisplay
Item); | |
| 25 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); | 20 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); |
| 26 | 21 |
| 27 // A container for a list of display items. | 22 // A container for a list of display items. |
| 28 class PLATFORM_EXPORT DisplayItemList : public ContiguousContainer<DisplayItem,
kDisplayItemAlignment> { | 23 class PLATFORM_EXPORT DisplayItemList : public ContiguousContainer<DisplayItem>
{ |
| 29 public: | 24 public: |
| 30 DisplayItemList(size_t initialSizeBytes) | 25 DisplayItemList(size_t initialSizeBytes) |
| 31 : ContiguousContainer(kMaximumDisplayItemSize, initialSizeBytes) {} | 26 : ContiguousContainer(kMaximumDisplayItemSize, initialSizeBytes) {} |
| 32 DisplayItemList(DisplayItemList&& source) | 27 DisplayItemList(DisplayItemList&& source) |
| 33 : ContiguousContainer(std::move(source)) | 28 : ContiguousContainer(std::move(source)) |
| 34 , m_visualRects(std::move(source.m_visualRects)) | 29 , m_visualRects(std::move(source.m_visualRects)) |
| 35 , m_beginItemIndices(std::move(source.m_beginItemIndices)) | 30 , m_beginItemIndices(std::move(source.m_beginItemIndices)) |
| 36 {} | 31 {} |
| 37 | 32 |
| 38 DisplayItemList& operator=(DisplayItemList&& source) | 33 DisplayItemList& operator=(DisplayItemList&& source) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // given visual rect with the begin display item's visual rect. | 68 // given visual rect with the begin display item's visual rect. |
| 74 void growCurrentBeginItemVisualRect(const IntRect& visualRect); | 69 void growCurrentBeginItemVisualRect(const IntRect& visualRect); |
| 75 | 70 |
| 76 Vector<IntRect> m_visualRects; | 71 Vector<IntRect> m_visualRects; |
| 77 Vector<size_t> m_beginItemIndices; | 72 Vector<size_t> m_beginItemIndices; |
| 78 }; | 73 }; |
| 79 | 74 |
| 80 } // namespace blink | 75 } // namespace blink |
| 81 | 76 |
| 82 #endif // DisplayItemList_h | 77 #endif // DisplayItemList_h |
| OLD | NEW |