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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); | 25 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem
); |
26 | 26 |
27 // A container for a list of display items. | 27 // A container for a list of display items. |
28 class PLATFORM_EXPORT DisplayItemList : public ContiguousContainer<DisplayItem,
kDisplayItemAlignment> { | 28 class PLATFORM_EXPORT DisplayItemList : public ContiguousContainer<DisplayItem,
kDisplayItemAlignment> { |
29 public: | 29 public: |
30 DisplayItemList(size_t initialSizeBytes) | 30 DisplayItemList(size_t initialSizeBytes) |
31 : ContiguousContainer(kMaximumDisplayItemSize, initialSizeBytes) {} | 31 : ContiguousContainer(kMaximumDisplayItemSize, initialSizeBytes) {} |
32 DisplayItemList(DisplayItemList&& source) | 32 DisplayItemList(DisplayItemList&& source) |
33 : ContiguousContainer(std::move(source)) | 33 : ContiguousContainer(std::move(source)) |
34 , m_visualRects(std::move(source.m_visualRects)) | 34 , m_visualRects(std::move(source.m_visualRects)) |
35 , m_beginItemIndices(std::move(source.m_beginItemIndices)) | |
36 {} | 35 {} |
37 | 36 |
38 DisplayItemList& operator=(DisplayItemList&& source) | 37 DisplayItemList& operator=(DisplayItemList&& source) |
39 { | 38 { |
40 ContiguousContainer::operator=(std::move(source)); | 39 ContiguousContainer::operator=(std::move(source)); |
41 m_visualRects = std::move(source.m_visualRects); | 40 m_visualRects = std::move(source.m_visualRects); |
42 m_beginItemIndices = std::move(source.m_beginItemIndices); | |
43 return *this; | 41 return *this; |
44 } | 42 } |
45 | 43 |
46 DisplayItem& appendByMoving(DisplayItem&); | 44 DisplayItem& appendByMoving(DisplayItem&); |
47 | 45 |
48 bool hasVisualRect(size_t index) const { return index < m_visualRects.size()
; } | 46 bool hasVisualRect(size_t index) const { return index < m_visualRects.size()
; } |
49 IntRect visualRect(size_t index) const | 47 IntRect visualRect(size_t index) const |
50 { | 48 { |
51 DCHECK(hasVisualRect(index)); | 49 DCHECK(hasVisualRect(index)); |
52 return m_visualRects[index]; | 50 return m_visualRects[index]; |
(...skipping 10 matching lines...) Expand all Loading... |
63 Iterator begin() const { return m_begin; } | 61 Iterator begin() const { return m_begin; } |
64 Iterator end() const { return m_end; } | 62 Iterator end() const { return m_end; } |
65 private: | 63 private: |
66 Iterator m_begin; | 64 Iterator m_begin; |
67 Iterator m_end; | 65 Iterator m_end; |
68 }; | 66 }; |
69 Range<iterator> itemsInPaintChunk(const PaintChunk&); | 67 Range<iterator> itemsInPaintChunk(const PaintChunk&); |
70 Range<const_iterator> itemsInPaintChunk(const PaintChunk&) const; | 68 Range<const_iterator> itemsInPaintChunk(const PaintChunk&) const; |
71 | 69 |
72 private: | 70 private: |
73 // If we're currently within a paired display item block, unions the | |
74 // given visual rect with the begin display item's visual rect. | |
75 void growCurrentBeginItemVisualRect(const IntRect& visualRect); | |
76 | |
77 Vector<IntRect> m_visualRects; | 71 Vector<IntRect> m_visualRects; |
78 Vector<size_t> m_beginItemIndices; | |
79 }; | 72 }; |
80 | 73 |
81 } // namespace blink | 74 } // namespace blink |
82 | 75 |
83 #endif // DisplayItemList_h | 76 #endif // DisplayItemList_h |
OLD | NEW |