| 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 CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 5 #ifndef CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
| 6 #define CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 6 #define CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 template <typename DisplayItemType> | 47 template <typename DisplayItemType> |
| 48 DisplayItemType* CreateAndAppendItem() { | 48 DisplayItemType* CreateAndAppendItem() { |
| 49 #if DCHECK_IS_ON() | 49 #if DCHECK_IS_ON() |
| 50 needs_process_ = true; | 50 needs_process_ = true; |
| 51 #endif | 51 #endif |
| 52 ProcessAppendedItemsOnTheFly(); | 52 ProcessAppendedItemsOnTheFly(); |
| 53 return items_.AllocateAndConstruct<DisplayItemType>(); | 53 return items_.AllocateAndConstruct<DisplayItemType>(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Removes the last item. This cannot be called on lists with cached pictures |
| 57 // (since the data may already have been incorporated into cached picture |
| 58 // sizes, etc). |
| 59 void RemoveLast(); |
| 60 |
| 56 // Called after all items are appended, to process the items and, if | 61 // Called after all items are appended, to process the items and, if |
| 57 // applicable, create an internally cached SkPicture. | 62 // applicable, create an internally cached SkPicture. |
| 58 void Finalize(); | 63 void Finalize(); |
| 59 | 64 |
| 60 bool IsSuitableForGpuRasterization() const; | 65 bool IsSuitableForGpuRasterization() const; |
| 61 int ApproximateOpCount() const; | 66 int ApproximateOpCount() const; |
| 62 size_t PictureMemoryUsage() const; | 67 size_t PictureMemoryUsage() const; |
| 63 | 68 |
| 64 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 69 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
| 65 | 70 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 111 |
| 107 friend class base::RefCountedThreadSafe<DisplayItemList>; | 112 friend class base::RefCountedThreadSafe<DisplayItemList>; |
| 108 friend class PixelRefMap::Iterator; | 113 friend class PixelRefMap::Iterator; |
| 109 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, PictureMemoryUsage); | 114 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, PictureMemoryUsage); |
| 110 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 115 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
| 111 }; | 116 }; |
| 112 | 117 |
| 113 } // namespace cc | 118 } // namespace cc |
| 114 | 119 |
| 115 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 120 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
| OLD | NEW |