| 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_PAINT_DISPLAY_ITEM_LIST_H_ |
| 6 #define CC_PLAYBACK_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> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
| 17 #include "cc/base/cc_export.h" | |
| 18 #include "cc/base/contiguous_container.h" | 17 #include "cc/base/contiguous_container.h" |
| 19 #include "cc/base/rtree.h" | 18 #include "cc/base/rtree.h" |
| 20 #include "cc/playback/discardable_image_map.h" | 19 #include "cc/paint/discardable_image_map.h" |
| 21 #include "cc/playback/display_item.h" | 20 #include "cc/paint/display_item.h" |
| 22 #include "cc/playback/image_id.h" | 21 #include "cc/paint/draw_image.h" |
| 22 #include "cc/paint/image_id.h" |
| 23 #include "cc/paint/paint_export.h" |
| 23 #include "third_party/skia/include/core/SkPicture.h" | 24 #include "third_party/skia/include/core/SkPicture.h" |
| 24 #include "ui/gfx/color_space.h" | 25 #include "ui/gfx/color_space.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 26 #include "ui/gfx/geometry/rect.h" |
| 26 #include "ui/gfx/geometry/rect_conversions.h" | 27 #include "ui/gfx/geometry/rect_conversions.h" |
| 27 | 28 |
| 28 class SkCanvas; | 29 class SkCanvas; |
| 29 | 30 |
| 30 namespace base { | 31 namespace base { |
| 31 namespace trace_event { | 32 namespace trace_event { |
| 32 class TracedValue; | 33 class TracedValue; |
| 33 } | 34 } |
| 34 } | 35 } |
| 35 | 36 |
| 36 namespace cc { | 37 namespace cc { |
| 37 class DisplayItem; | 38 class DisplayItem; |
| 38 | 39 |
| 39 class CC_EXPORT DisplayItemList | 40 class CC_PAINT_EXPORT DisplayItemList |
| 40 : public base::RefCountedThreadSafe<DisplayItemList> { | 41 : public base::RefCountedThreadSafe<DisplayItemList> { |
| 41 public: | 42 public: |
| 42 DisplayItemList(); | 43 DisplayItemList(); |
| 43 | 44 |
| 44 // TODO(trchen): Deprecated. Apply clip and scale on the canvas instead. | 45 // TODO(trchen): Deprecated. Apply clip and scale on the canvas instead. |
| 45 void Raster(SkCanvas* canvas, | 46 void Raster(SkCanvas* canvas, |
| 46 SkPicture::AbortCallback* callback, | 47 SkPicture::AbortCallback* callback, |
| 47 const gfx::Rect& canvas_target_playback_rect, | 48 const gfx::Rect& canvas_target_playback_rect, |
| 48 float contents_scale) const; | 49 float contents_scale) const; |
| 49 | 50 |
| 50 void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 51 void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 51 | 52 |
| 52 | |
| 53 // Because processing happens in these CreateAndAppend functions, all the set | 53 // 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 | 54 // 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. | 55 // needs to be const, to prevent set-after-processing mistakes. |
| 56 | 56 |
| 57 // Most paired begin item types default to an empty visual rect, which will | 57 // 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 | 58 // subsequently be grown as needed to encompass any contained items that draw |
| 59 // content, such as drawing or filter items. | 59 // content, such as drawing or filter items. |
| 60 template <typename DisplayItemType, typename... Args> | 60 template <typename DisplayItemType, typename... Args> |
| 61 const DisplayItemType& CreateAndAppendPairedBeginItem(Args&&... args) { | 61 const DisplayItemType& CreateAndAppendPairedBeginItem(Args&&... args) { |
| 62 return CreateAndAppendPairedBeginItemWithVisualRect<DisplayItemType>( | 62 return CreateAndAppendPairedBeginItemWithVisualRect<DisplayItemType>( |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 Inputs inputs_; | 210 Inputs inputs_; |
| 211 | 211 |
| 212 friend class base::RefCountedThreadSafe<DisplayItemList>; | 212 friend class base::RefCountedThreadSafe<DisplayItemList>; |
| 213 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); | 213 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage); |
| 214 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 214 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 } // namespace cc | 217 } // namespace cc |
| 218 | 218 |
| 219 #endif // CC_PLAYBACK_DISPLAY_ITEM_LIST_H_ | 219 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ |
| OLD | NEW |