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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // periodically to avoid retaining all the items and processing at the end. | 93 // periodically to avoid retaining all the items and processing at the end. |
94 void ProcessAppendedItemsOnTheFly(); | 94 void ProcessAppendedItemsOnTheFly(); |
95 void ProcessAppendedItems(); | 95 void ProcessAppendedItems(); |
96 #if DCHECK_IS_ON() | 96 #if DCHECK_IS_ON() |
97 bool ProcessAppendedItemsCalled() const { return !needs_process_; } | 97 bool ProcessAppendedItemsCalled() const { return !needs_process_; } |
98 bool needs_process_; | 98 bool needs_process_; |
99 #else | 99 #else |
100 bool ProcessAppendedItemsCalled() const { return true; } | 100 bool ProcessAppendedItemsCalled() const { return true; } |
101 #endif | 101 #endif |
102 | 102 |
103 ListContainer<DisplayItem> items_; | 103 RandomAccessListContainer<DisplayItem> items_; |
104 skia::RefPtr<SkPicture> picture_; | 104 skia::RefPtr<SkPicture> picture_; |
105 | 105 |
106 scoped_ptr<SkPictureRecorder> recorder_; | 106 scoped_ptr<SkPictureRecorder> recorder_; |
107 skia::RefPtr<SkCanvas> canvas_; | 107 skia::RefPtr<SkCanvas> canvas_; |
108 bool use_cached_picture_; | 108 bool use_cached_picture_; |
109 bool retain_individual_display_items_; | 109 bool retain_individual_display_items_; |
110 | 110 |
111 gfx::Rect layer_rect_; | 111 gfx::Rect layer_rect_; |
112 bool all_items_are_suitable_for_gpu_rasterization_; | 112 bool all_items_are_suitable_for_gpu_rasterization_; |
113 int approximate_op_count_; | 113 int approximate_op_count_; |
114 | 114 |
115 // Memory usage due to the cached SkPicture. | 115 // Memory usage due to the cached SkPicture. |
116 size_t picture_memory_usage_; | 116 size_t picture_memory_usage_; |
117 | 117 |
118 // Memory usage due to external data held by display items. | 118 // Memory usage due to external data held by display items. |
119 size_t external_memory_usage_; | 119 size_t external_memory_usage_; |
120 | 120 |
121 scoped_ptr<DiscardableImageMap> images_; | 121 scoped_ptr<DiscardableImageMap> images_; |
122 | 122 |
123 friend class base::RefCountedThreadSafe<DisplayItemList>; | 123 friend class base::RefCountedThreadSafe<DisplayItemList>; |
124 friend class DiscardableImageMap::Iterator; | 124 friend class DiscardableImageMap::Iterator; |
125 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 125 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
126 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 126 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace cc | 129 } // namespace cc |
130 | 130 |
131 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 131 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |