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 "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
13 #include "cc/base/scoped_ptr_vector.h" | 13 #include "cc/base/scoped_ptr_vector.h" |
14 #include "cc/playback/display_item.h" | 14 #include "cc/playback/display_item.h" |
15 #include "cc/playback/pixel_ref_map.h" | 15 #include "cc/playback/pixel_ref_map.h" |
16 // TODO(danakj): Move ListContainer out of cc/quads/ | 16 // TODO(danakj): Move ListContainer out of cc/quads/ |
17 #include "cc/quads/list_container.h" | 17 #include "cc/quads/list_container.h" |
18 #include "skia/ext/refptr.h" | 18 #include "skia/ext/refptr.h" |
19 #include "third_party/skia/include/core/SkPicture.h" | 19 #include "third_party/skia/include/core/SkPicture.h" |
20 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
21 | 21 |
22 class SkCanvas; | 22 class SkCanvas; |
23 class SkDrawPictureCallback; | |
24 class SkPictureRecorder; | 23 class SkPictureRecorder; |
25 | 24 |
26 namespace cc { | 25 namespace cc { |
27 | 26 |
28 class CC_EXPORT DisplayItemList | 27 class CC_EXPORT DisplayItemList |
29 : public base::RefCountedThreadSafe<DisplayItemList> { | 28 : public base::RefCountedThreadSafe<DisplayItemList> { |
30 public: | 29 public: |
31 static scoped_refptr<DisplayItemList> Create(gfx::Rect layer_rect, | 30 static scoped_refptr<DisplayItemList> Create(gfx::Rect layer_rect, |
32 bool use_cached_picture); | 31 bool use_cached_picture); |
33 | 32 |
34 void Raster(SkCanvas* canvas, | 33 void Raster(SkCanvas* canvas, |
35 SkDrawPictureCallback* callback, | 34 SkPicture::AbortCallback* callback, |
36 float contents_scale) const; | 35 float contents_scale) const; |
37 | 36 |
38 template <typename DisplayItemType> | 37 template <typename DisplayItemType> |
39 DisplayItemType* CreateAndAppendItem() { | 38 DisplayItemType* CreateAndAppendItem() { |
40 #if DCHECK_IS_ON() | 39 #if DCHECK_IS_ON() |
41 needs_process_ = true; | 40 needs_process_ = true; |
42 #endif | 41 #endif |
43 ProcessAppendedItemsOnTheFly(); | 42 ProcessAppendedItemsOnTheFly(); |
44 return items_.AllocateAndConstruct<DisplayItemType>(); | 43 return items_.AllocateAndConstruct<DisplayItemType>(); |
45 } | 44 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 90 |
92 friend class base::RefCountedThreadSafe<DisplayItemList>; | 91 friend class base::RefCountedThreadSafe<DisplayItemList>; |
93 friend class PixelRefMap::Iterator; | 92 friend class PixelRefMap::Iterator; |
94 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, PictureMemoryUsage); | 93 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, PictureMemoryUsage); |
95 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 94 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
96 }; | 95 }; |
97 | 96 |
98 } // namespace cc | 97 } // namespace cc |
99 | 98 |
100 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 99 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |