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_PAINT_DISPLAY_ITEM_LIST_H_ | 5 #ifndef CC_PAINT_DISPLAY_ITEM_LIST_H_ |
6 #define CC_PAINT_DISPLAY_ITEM_LIST_H_ | 6 #define CC_PAINT_DISPLAY_ITEM_LIST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 namespace cc { | 37 namespace cc { |
38 class DisplayItem; | 38 class DisplayItem; |
39 | 39 |
40 class CC_PAINT_EXPORT DisplayItemList | 40 class CC_PAINT_EXPORT DisplayItemList |
41 : public base::RefCountedThreadSafe<DisplayItemList> { | 41 : public base::RefCountedThreadSafe<DisplayItemList> { |
42 public: | 42 public: |
43 DisplayItemList(); | 43 DisplayItemList(); |
44 | 44 |
45 // TODO(trchen): Deprecated. Apply clip and scale on the canvas instead. | |
46 void Raster(SkCanvas* canvas, | 45 void Raster(SkCanvas* canvas, |
47 SkPicture::AbortCallback* callback, | 46 SkPicture::AbortCallback* callback = nullptr) const; |
48 const gfx::Rect& canvas_target_playback_rect, | |
49 float contents_scale) const; | |
50 | |
51 void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | |
52 | 47 |
53 // Because processing happens in these CreateAndAppend functions, all the set | 48 // Because processing happens in these CreateAndAppend functions, all the set |
54 // up for the item should be done via the args, which is why the return type | 49 // up for the item should be done via the args, which is why the return type |
55 // needs to be const, to prevent set-after-processing mistakes. | 50 // needs to be const, to prevent set-after-processing mistakes. |
56 | 51 |
57 // Most paired begin item types default to an empty visual rect, which will | 52 // Most paired begin item types default to an empty visual rect, which will |
58 // subsequently be grown as needed to encompass any contained items that draw | 53 // subsequently be grown as needed to encompass any contained items that draw |
59 // content, such as drawing or filter items. | 54 // content, such as drawing or filter items. |
60 template <typename DisplayItemType, typename... Args> | 55 template <typename DisplayItemType, typename... Args> |
61 const DisplayItemType& CreateAndAppendPairedBeginItem(Args&&... args) { | 56 const DisplayItemType& CreateAndAppendPairedBeginItem(Args&&... args) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bool has_discardable_images_ = false; | 207 bool has_discardable_images_ = false; |
213 | 208 |
214 friend class base::RefCountedThreadSafe<DisplayItemList>; | 209 friend class base::RefCountedThreadSafe<DisplayItemList>; |
215 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 210 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
216 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 211 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
217 }; | 212 }; |
218 | 213 |
219 } // namespace cc | 214 } // namespace cc |
220 | 215 |
221 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ | 216 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |