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/graphics/paint/DisplayItem.h" | 9 #include "platform/graphics/paint/DisplayItem.h" |
10 #include "platform/graphics/paint/DisplayItems.h" | 10 #include "platform/graphics/paint/DisplayItems.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 static PassOwnPtr<DisplayItemList> create() | 23 static PassOwnPtr<DisplayItemList> create() |
24 { | 24 { |
25 return adoptPtr(new DisplayItemList()); | 25 return adoptPtr(new DisplayItemList()); |
26 } | 26 } |
27 | 27 |
28 // These methods are called during paint invalidation. | 28 // These methods are called during paint invalidation. |
29 void invalidate(DisplayItemClient); | 29 void invalidate(DisplayItemClient); |
30 void invalidateAll(); | 30 void invalidateAll(); |
31 | 31 |
32 // These methods are called during painting. | 32 // These methods are called during painting. |
33 void add(WTF::PassOwnPtr<DisplayItem>); | 33 |
| 34 // Moves from the provided display item for efficiency. |
| 35 // (i.e. some values, like DrawingDisplayItem's picture, may be null) |
| 36 void add(DisplayItem&); |
| 37 |
34 void beginScope(DisplayItemClient); | 38 void beginScope(DisplayItemClient); |
35 void endScope(DisplayItemClient); | 39 void endScope(DisplayItemClient); |
36 | 40 |
37 void beginSkippingCache() { ++m_skippingCacheCount; } | 41 void beginSkippingCache() { ++m_skippingCacheCount; } |
38 void endSkippingCache() { ASSERT(m_skippingCacheCount > 0); --m_skippingCach
eCount; } | 42 void endSkippingCache() { ASSERT(m_skippingCacheCount > 0); --m_skippingCach
eCount; } |
39 bool skippingCache() const { return m_skippingCacheCount; } | 43 bool skippingCache() const { return m_skippingCacheCount; } |
40 | 44 |
41 // Must be called when a painting is finished. | 45 // Must be called when a painting is finished. |
42 void commitNewDisplayItems(); | 46 void commitNewDisplayItems(); |
43 | 47 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // This is used to check duplicated ids during add(). We could also check du
ring | 137 // This is used to check duplicated ids during add(). We could also check du
ring |
134 // updatePaintList(), but checking during add() helps developer easily find
where | 138 // updatePaintList(), but checking during add() helps developer easily find
where |
135 // the duplicated ids are from. | 139 // the duplicated ids are from. |
136 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; | 140 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; |
137 #endif | 141 #endif |
138 }; | 142 }; |
139 | 143 |
140 } // namespace blink | 144 } // namespace blink |
141 | 145 |
142 #endif // DisplayItemList_h | 146 #endif // DisplayItemList_h |
OLD | NEW |