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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
17 #include "cc/base/cc_export.h" | 17 #include "cc/base/cc_export.h" |
18 #include "cc/base/contiguous_container.h" | 18 #include "cc/base/contiguous_container.h" |
19 #include "cc/playback/discardable_image_map.h" | 19 #include "cc/playback/discardable_image_map.h" |
20 #include "cc/playback/display_item.h" | 20 #include "cc/playback/display_item.h" |
21 #include "cc/playback/display_item_list_settings.h" | 21 #include "cc/playback/display_item_list_settings.h" |
22 #include "skia/ext/refptr.h" | |
23 #include "third_party/skia/include/core/SkPicture.h" | 22 #include "third_party/skia/include/core/SkPicture.h" |
24 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
25 | 24 |
26 class SkCanvas; | 25 class SkCanvas; |
27 class SkPictureRecorder; | 26 class SkPictureRecorder; |
28 | 27 |
29 namespace cc { | 28 namespace cc { |
30 class DisplayItem; | 29 class DisplayItem; |
31 class DrawingDisplayItem; | 30 class DrawingDisplayItem; |
32 class ImageSerializationProcessor; | 31 class ImageSerializationProcessor; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ContiguousContainer<DisplayItem> items_; | 121 ContiguousContainer<DisplayItem> items_; |
123 // The visual rects associated with each of the display items in the | 122 // The visual rects associated with each of the display items in the |
124 // display item list. There is one rect per display item, and the | 123 // display item list. There is one rect per display item, and the |
125 // position in |visual_rects_| matches the position of the item in | 124 // position in |visual_rects_| matches the position of the item in |
126 // |items_| . These rects are intentionally kept separate | 125 // |items_| . These rects are intentionally kept separate |
127 // because they are not needed while walking the |items_| for raster. | 126 // because they are not needed while walking the |items_| for raster. |
128 std::vector<gfx::Rect> visual_rects_; | 127 std::vector<gfx::Rect> visual_rects_; |
129 sk_sp<SkPicture> picture_; | 128 sk_sp<SkPicture> picture_; |
130 | 129 |
131 std::unique_ptr<SkPictureRecorder> recorder_; | 130 std::unique_ptr<SkPictureRecorder> recorder_; |
132 skia::RefPtr<SkCanvas> canvas_; | 131 sk_sp<SkCanvas> canvas_; |
133 const DisplayItemListSettings settings_; | 132 const DisplayItemListSettings settings_; |
134 bool retain_individual_display_items_; | 133 bool retain_individual_display_items_; |
135 | 134 |
136 gfx::Rect layer_rect_; | 135 gfx::Rect layer_rect_; |
137 bool is_suitable_for_gpu_rasterization_; | 136 bool is_suitable_for_gpu_rasterization_; |
138 int approximate_op_count_; | 137 int approximate_op_count_; |
139 | 138 |
140 // Memory usage due to the cached SkPicture. | 139 // Memory usage due to the cached SkPicture. |
141 size_t picture_memory_usage_; | 140 size_t picture_memory_usage_; |
142 | 141 |
143 DiscardableImageMap image_map_; | 142 DiscardableImageMap image_map_; |
144 | 143 |
145 friend class base::RefCountedThreadSafe<DisplayItemList>; | 144 friend class base::RefCountedThreadSafe<DisplayItemList>; |
146 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 145 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
147 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 146 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
148 }; | 147 }; |
149 | 148 |
150 } // namespace cc | 149 } // namespace cc |
151 | 150 |
152 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 151 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |