| 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 10 matching lines...) Expand all Loading... |
| 21 #include "cc/playback/display_item.h" | 21 #include "cc/playback/display_item.h" |
| 22 #include "cc/playback/display_item_list_settings.h" | 22 #include "cc/playback/display_item_list_settings.h" |
| 23 #include "third_party/skia/include/core/SkPicture.h" | 23 #include "third_party/skia/include/core/SkPicture.h" |
| 24 #include "ui/gfx/color_space.h" | 24 #include "ui/gfx/color_space.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
| 26 #include "ui/gfx/geometry/rect_conversions.h" | 26 #include "ui/gfx/geometry/rect_conversions.h" |
| 27 | 27 |
| 28 class SkCanvas; | 28 class SkCanvas; |
| 29 | 29 |
| 30 namespace cc { | 30 namespace cc { |
| 31 class ClientPictureCache; | |
| 32 class DisplayItem; | 31 class DisplayItem; |
| 33 | 32 |
| 34 namespace proto { | |
| 35 class DisplayItemList; | |
| 36 } | |
| 37 | |
| 38 class CC_EXPORT DisplayItemList | 33 class CC_EXPORT DisplayItemList |
| 39 : public base::RefCountedThreadSafe<DisplayItemList> { | 34 : public base::RefCountedThreadSafe<DisplayItemList> { |
| 40 public: | 35 public: |
| 41 // Creates a display item list. | 36 // Creates a display item list. |
| 42 static scoped_refptr<DisplayItemList> Create( | 37 static scoped_refptr<DisplayItemList> Create( |
| 43 const DisplayItemListSettings& settings); | 38 const DisplayItemListSettings& settings); |
| 44 | 39 |
| 45 // Creates a DisplayItemList from a Protobuf. | |
| 46 // TODO(dtrainor): Pass in a list of possible DisplayItems to reuse | |
| 47 // (crbug.com/548434). | |
| 48 static scoped_refptr<DisplayItemList> CreateFromProto( | |
| 49 const proto::DisplayItemList& proto, | |
| 50 ClientPictureCache* client_picture_cache, | |
| 51 std::vector<uint32_t>* used_engine_picture_ids); | |
| 52 | |
| 53 // Creates a Protobuf representing the state of this DisplayItemList. | |
| 54 void ToProtobuf(proto::DisplayItemList* proto); | |
| 55 | |
| 56 // TODO(trchen): Deprecated. Apply clip and scale on the canvas instead. | 40 // TODO(trchen): Deprecated. Apply clip and scale on the canvas instead. |
| 57 void Raster(SkCanvas* canvas, | 41 void Raster(SkCanvas* canvas, |
| 58 SkPicture::AbortCallback* callback, | 42 SkPicture::AbortCallback* callback, |
| 59 const gfx::Rect& canvas_target_playback_rect, | 43 const gfx::Rect& canvas_target_playback_rect, |
| 60 float contents_scale) const; | 44 float contents_scale) const; |
| 61 | 45 |
| 62 void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 46 void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 63 | 47 |
| 64 | 48 |
| 65 // Because processing happens in these CreateAndAppend functions, all the set | 49 // Because processing happens in these CreateAndAppend functions, all the set |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 Inputs inputs_; | 218 Inputs inputs_; |
| 235 | 219 |
| 236 friend class base::RefCountedThreadSafe<DisplayItemList>; | 220 friend class base::RefCountedThreadSafe<DisplayItemList>; |
| 237 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 221 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
| 238 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 222 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
| 239 }; | 223 }; |
| 240 | 224 |
| 241 } // namespace cc | 225 } // namespace cc |
| 242 | 226 |
| 243 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 227 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
| OLD | NEW |