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> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 static scoped_refptr<DisplayItemList> CreateFromProto( | 52 static scoped_refptr<DisplayItemList> CreateFromProto( |
53 const proto::DisplayItemList& proto, | 53 const proto::DisplayItemList& proto, |
54 ImageSerializationProcessor* image_serialization_processor); | 54 ImageSerializationProcessor* image_serialization_processor); |
55 | 55 |
56 // Creates a Protobuf representing the state of this DisplayItemList. | 56 // Creates a Protobuf representing the state of this DisplayItemList. |
57 // TODO(dtrainor): Don't resend DisplayItems that were already serialized | 57 // TODO(dtrainor): Don't resend DisplayItems that were already serialized |
58 // (crbug.com/548434). | 58 // (crbug.com/548434). |
59 void ToProtobuf(proto::DisplayItemList* proto, | 59 void ToProtobuf(proto::DisplayItemList* proto, |
60 ImageSerializationProcessor* image_serialization_processor); | 60 ImageSerializationProcessor* image_serialization_processor); |
61 | 61 |
| 62 // TODO(trchen): Deprecated. Apply clip and scale on the canvas instead. |
62 void Raster(SkCanvas* canvas, | 63 void Raster(SkCanvas* canvas, |
63 SkPicture::AbortCallback* callback, | 64 SkPicture::AbortCallback* callback, |
64 const gfx::Rect& canvas_target_playback_rect, | 65 const gfx::Rect& canvas_target_playback_rect, |
65 float contents_scale) const; | 66 float contents_scale) const; |
66 | 67 |
| 68 void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 69 |
67 // This is a fast path for use only if canvas_ is set and | 70 // This is a fast path for use only if canvas_ is set and |
68 // retain_individual_display_items_ is false. This method also updates | 71 // retain_individual_display_items_ is false. This method also updates |
69 // approximate_op_count_. | 72 // approximate_op_count_. |
70 void RasterIntoCanvas(const DisplayItem& display_item); | 73 void RasterIntoCanvas(const DisplayItem& display_item); |
71 | 74 |
72 // Because processing happens in this function, all the set up for | 75 // Because processing happens in this function, all the set up for |
73 // this item should be done via the args, which is why the return | 76 // this item should be done via the args, which is why the return |
74 // type needs to be const, to prevent set-after-processing mistakes. | 77 // type needs to be const, to prevent set-after-processing mistakes. |
75 template <typename DisplayItemType, typename... Args> | 78 template <typename DisplayItemType, typename... Args> |
76 const DisplayItemType& CreateAndAppendItem(const gfx::Rect& visual_rect, | 79 const DisplayItemType& CreateAndAppendItem(const gfx::Rect& visual_rect, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 DiscardableImageMap image_map_; | 143 DiscardableImageMap image_map_; |
141 | 144 |
142 friend class base::RefCountedThreadSafe<DisplayItemList>; | 145 friend class base::RefCountedThreadSafe<DisplayItemList>; |
143 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 146 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
144 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 147 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
145 }; | 148 }; |
146 | 149 |
147 } // namespace cc | 150 } // namespace cc |
148 | 151 |
149 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 152 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |