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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ContiguousContainer<DisplayItem> items_; | 122 ContiguousContainer<DisplayItem> items_; |
124 // The visual rects associated with each of the display items in the | 123 // The visual rects associated with each of the display items in the |
125 // display item list. There is one rect per display item, and the | 124 // display item list. There is one rect per display item, and the |
126 // position in |visual_rects_| matches the position of the item in | 125 // position in |visual_rects_| matches the position of the item in |
127 // |items_| . These rects are intentionally kept separate | 126 // |items_| . These rects are intentionally kept separate |
128 // because they are not needed while walking the |items_| for raster. | 127 // because they are not needed while walking the |items_| for raster. |
129 std::vector<gfx::Rect> visual_rects_; | 128 std::vector<gfx::Rect> visual_rects_; |
130 sk_sp<SkPicture> picture_; | 129 sk_sp<SkPicture> picture_; |
131 | 130 |
132 std::unique_ptr<SkPictureRecorder> recorder_; | 131 std::unique_ptr<SkPictureRecorder> recorder_; |
133 skia::RefPtr<SkCanvas> canvas_; | 132 sk_sp<SkCanvas> canvas_; |
134 const DisplayItemListSettings settings_; | 133 const DisplayItemListSettings settings_; |
135 bool retain_individual_display_items_; | 134 bool retain_individual_display_items_; |
136 | 135 |
137 gfx::Rect layer_rect_; | 136 gfx::Rect layer_rect_; |
138 bool is_suitable_for_gpu_rasterization_; | 137 bool is_suitable_for_gpu_rasterization_; |
139 int approximate_op_count_; | 138 int approximate_op_count_; |
140 | 139 |
141 // Memory usage due to the cached SkPicture. | 140 // Memory usage due to the cached SkPicture. |
142 size_t picture_memory_usage_; | 141 size_t picture_memory_usage_; |
143 | 142 |
144 DiscardableImageMap image_map_; | 143 DiscardableImageMap image_map_; |
145 | 144 |
146 friend class base::RefCountedThreadSafe<DisplayItemList>; | 145 friend class base::RefCountedThreadSafe<DisplayItemList>; |
147 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 146 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
148 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 147 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
149 }; | 148 }; |
150 | 149 |
151 } // namespace cc | 150 } // namespace cc |
152 | 151 |
153 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 152 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |