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 27 matching lines...) Expand all Loading... |
38 DisplayItemList& operator=(DisplayItemList&& source) | 38 DisplayItemList& operator=(DisplayItemList&& source) |
39 { | 39 { |
40 ContiguousContainer::operator=(std::move(source)); | 40 ContiguousContainer::operator=(std::move(source)); |
41 m_visualRects = std::move(source.m_visualRects); | 41 m_visualRects = std::move(source.m_visualRects); |
42 m_beginItemIndices = std::move(source.m_beginItemIndices); | 42 m_beginItemIndices = std::move(source.m_beginItemIndices); |
43 return *this; | 43 return *this; |
44 } | 44 } |
45 | 45 |
46 DisplayItem& appendByMoving(DisplayItem&); | 46 DisplayItem& appendByMoving(DisplayItem&); |
47 | 47 |
48 bool hasVisualRect(unsigned index) const { return index < m_visualRects.size
(); } | |
49 IntRect visualRect(unsigned index) const | 48 IntRect visualRect(unsigned index) const |
50 { | 49 { |
51 DCHECK(hasVisualRect(index)); | 50 ASSERT(index < m_visualRects.size()); |
52 return m_visualRects[index]; | 51 return m_visualRects[index]; |
53 } | 52 } |
54 | 53 |
55 void appendVisualRect(const IntRect& visualRect); | 54 void appendVisualRect(const IntRect& visualRect); |
56 | 55 |
57 // Useful for iterating with a range-based for loop. | 56 // Useful for iterating with a range-based for loop. |
58 template <typename Iterator> | 57 template <typename Iterator> |
59 class Range { | 58 class Range { |
60 public: | 59 public: |
61 Range(const Iterator& begin, const Iterator& end) | 60 Range(const Iterator& begin, const Iterator& end) |
(...skipping 12 matching lines...) Expand all Loading... |
74 // given visual rect with the begin display item's visual rect. | 73 // given visual rect with the begin display item's visual rect. |
75 void growCurrentBeginItemVisualRect(const IntRect& visualRect); | 74 void growCurrentBeginItemVisualRect(const IntRect& visualRect); |
76 | 75 |
77 Vector<IntRect> m_visualRects; | 76 Vector<IntRect> m_visualRects; |
78 Vector<size_t> m_beginItemIndices; | 77 Vector<size_t> m_beginItemIndices; |
79 }; | 78 }; |
80 | 79 |
81 } // namespace blink | 80 } // namespace blink |
82 | 81 |
83 #endif // DisplayItemList_h | 82 #endif // DisplayItemList_h |
OLD | NEW |