| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // is used). The resulting display list will not support sidecar data. | 35 // is used). The resulting display list will not support sidecar data. |
| 36 static scoped_refptr<DisplayItemList> Create(gfx::Rect layer_rect, | 36 static scoped_refptr<DisplayItemList> Create(gfx::Rect layer_rect, |
| 37 bool use_cached_picture); | 37 bool use_cached_picture); |
| 38 | 38 |
| 39 static scoped_refptr<DisplayItemList> Create( | 39 static scoped_refptr<DisplayItemList> Create( |
| 40 gfx::Rect layer_rect, | 40 gfx::Rect layer_rect, |
| 41 const DisplayItemListSettings& settings); | 41 const DisplayItemListSettings& settings); |
| 42 | 42 |
| 43 void Raster(SkCanvas* canvas, | 43 void Raster(SkCanvas* canvas, |
| 44 SkPicture::AbortCallback* callback, | 44 SkPicture::AbortCallback* callback, |
| 45 const gfx::Rect& canvas_target_playback_rect, |
| 45 float contents_scale) const; | 46 float contents_scale) const; |
| 46 | 47 |
| 47 template <typename DisplayItemType> | 48 template <typename DisplayItemType> |
| 48 DisplayItemType* CreateAndAppendItem() { | 49 DisplayItemType* CreateAndAppendItem() { |
| 49 #if DCHECK_IS_ON() | 50 #if DCHECK_IS_ON() |
| 50 needs_process_ = true; | 51 needs_process_ = true; |
| 51 #endif | 52 #endif |
| 52 ProcessAppendedItemsOnTheFly(); | 53 ProcessAppendedItemsOnTheFly(); |
| 53 return items_.AllocateAndConstruct<DisplayItemType>(); | 54 return items_.AllocateAndConstruct<DisplayItemType>(); |
| 54 } | 55 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 107 |
| 107 friend class base::RefCountedThreadSafe<DisplayItemList>; | 108 friend class base::RefCountedThreadSafe<DisplayItemList>; |
| 108 friend class PixelRefMap::Iterator; | 109 friend class PixelRefMap::Iterator; |
| 109 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, PictureMemoryUsage); | 110 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, PictureMemoryUsage); |
| 110 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 111 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 } // namespace cc | 114 } // namespace cc |
| 114 | 115 |
| 115 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 116 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ |
| OLD | NEW |