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_TRANSFORM_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ |
6 #define CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 11 matching lines...) Expand all Loading... |
22 class CC_EXPORT TransformDisplayItem : public DisplayItem { | 22 class CC_EXPORT TransformDisplayItem : public DisplayItem { |
23 public: | 23 public: |
24 explicit TransformDisplayItem(const gfx::Transform& transform); | 24 explicit TransformDisplayItem(const gfx::Transform& transform); |
25 explicit TransformDisplayItem(const proto::DisplayItem& proto); | 25 explicit TransformDisplayItem(const proto::DisplayItem& proto); |
26 ~TransformDisplayItem() override; | 26 ~TransformDisplayItem() override; |
27 | 27 |
28 void ToProtobuf(proto::DisplayItem* proto, | 28 void ToProtobuf(proto::DisplayItem* proto, |
29 ImageSerializationProcessor* image_serialization_processor) | 29 ImageSerializationProcessor* image_serialization_processor) |
30 const override; | 30 const override; |
31 void Raster(SkCanvas* canvas, | 31 void Raster(SkCanvas* canvas, |
32 const gfx::Rect& canvas_target_playback_rect, | |
33 SkPicture::AbortCallback* callback) const override; | 32 SkPicture::AbortCallback* callback) const override; |
34 void AsValueInto(const gfx::Rect& visual_rect, | 33 void AsValueInto(const gfx::Rect& visual_rect, |
35 base::trace_event::TracedValue* array) const override; | 34 base::trace_event::TracedValue* array) const override; |
36 size_t ExternalMemoryUsage() const override; | 35 size_t ExternalMemoryUsage() const override; |
37 | 36 |
38 int ApproximateOpCount() const { return 1; } | 37 int ApproximateOpCount() const { return 1; } |
39 | 38 |
40 private: | 39 private: |
41 void SetNew(const gfx::Transform& transform); | 40 void SetNew(const gfx::Transform& transform); |
42 | 41 |
43 gfx::Transform transform_; | 42 gfx::Transform transform_; |
44 }; | 43 }; |
45 | 44 |
46 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { | 45 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { |
47 public: | 46 public: |
48 EndTransformDisplayItem(); | 47 EndTransformDisplayItem(); |
49 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); | 48 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); |
50 ~EndTransformDisplayItem() override; | 49 ~EndTransformDisplayItem() override; |
51 | 50 |
52 static std::unique_ptr<EndTransformDisplayItem> Create() { | 51 static std::unique_ptr<EndTransformDisplayItem> Create() { |
53 return base::WrapUnique(new EndTransformDisplayItem()); | 52 return base::WrapUnique(new EndTransformDisplayItem()); |
54 } | 53 } |
55 | 54 |
56 void ToProtobuf(proto::DisplayItem* proto, | 55 void ToProtobuf(proto::DisplayItem* proto, |
57 ImageSerializationProcessor* image_serialization_processor) | 56 ImageSerializationProcessor* image_serialization_processor) |
58 const override; | 57 const override; |
59 void Raster(SkCanvas* canvas, | 58 void Raster(SkCanvas* canvas, |
60 const gfx::Rect& canvas_target_playback_rect, | |
61 SkPicture::AbortCallback* callback) const override; | 59 SkPicture::AbortCallback* callback) const override; |
62 void AsValueInto(const gfx::Rect& visual_rect, | 60 void AsValueInto(const gfx::Rect& visual_rect, |
63 base::trace_event::TracedValue* array) const override; | 61 base::trace_event::TracedValue* array) const override; |
64 size_t ExternalMemoryUsage() const override; | 62 size_t ExternalMemoryUsage() const override; |
65 | 63 |
66 int ApproximateOpCount() const { return 0; } | 64 int ApproximateOpCount() const { return 0; } |
67 }; | 65 }; |
68 | 66 |
69 } // namespace cc | 67 } // namespace cc |
70 | 68 |
71 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ | 69 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ |
OLD | NEW |