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> |
11 | 11 |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/playback/display_item.h" | 14 #include "cc/playback/display_item.h" |
15 #include "ui/gfx/transform.h" | 15 #include "ui/gfx/transform.h" |
16 | 16 |
17 class SkCanvas; | 17 class SkCanvas; |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 class ImageSerializationProcessor; | |
21 | 20 |
22 class CC_EXPORT TransformDisplayItem : public DisplayItem { | 21 class CC_EXPORT TransformDisplayItem : public DisplayItem { |
23 public: | 22 public: |
24 explicit TransformDisplayItem(const gfx::Transform& transform); | 23 explicit TransformDisplayItem(const gfx::Transform& transform); |
25 explicit TransformDisplayItem(const proto::DisplayItem& proto); | 24 explicit TransformDisplayItem(const proto::DisplayItem& proto); |
26 ~TransformDisplayItem() override; | 25 ~TransformDisplayItem() override; |
27 | 26 |
28 void ToProtobuf(proto::DisplayItem* proto, | 27 void ToProtobuf(proto::DisplayItem* proto) const override; |
29 ImageSerializationProcessor* image_serialization_processor) | |
30 const override; | |
31 void Raster(SkCanvas* canvas, | 28 void Raster(SkCanvas* canvas, |
32 SkPicture::AbortCallback* callback) const override; | 29 SkPicture::AbortCallback* callback) const override; |
33 void AsValueInto(const gfx::Rect& visual_rect, | 30 void AsValueInto(const gfx::Rect& visual_rect, |
34 base::trace_event::TracedValue* array) const override; | 31 base::trace_event::TracedValue* array) const override; |
35 size_t ExternalMemoryUsage() const override; | 32 size_t ExternalMemoryUsage() const override; |
36 | 33 |
37 int ApproximateOpCount() const { return 1; } | 34 int ApproximateOpCount() const { return 1; } |
38 | 35 |
39 private: | 36 private: |
40 void SetNew(const gfx::Transform& transform); | 37 void SetNew(const gfx::Transform& transform); |
41 | 38 |
42 gfx::Transform transform_; | 39 gfx::Transform transform_; |
43 }; | 40 }; |
44 | 41 |
45 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { | 42 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { |
46 public: | 43 public: |
47 EndTransformDisplayItem(); | 44 EndTransformDisplayItem(); |
48 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); | 45 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); |
49 ~EndTransformDisplayItem() override; | 46 ~EndTransformDisplayItem() override; |
50 | 47 |
51 static std::unique_ptr<EndTransformDisplayItem> Create() { | 48 static std::unique_ptr<EndTransformDisplayItem> Create() { |
52 return base::WrapUnique(new EndTransformDisplayItem()); | 49 return base::WrapUnique(new EndTransformDisplayItem()); |
53 } | 50 } |
54 | 51 |
55 void ToProtobuf(proto::DisplayItem* proto, | 52 void ToProtobuf(proto::DisplayItem* proto) const override; |
56 ImageSerializationProcessor* image_serialization_processor) | |
57 const override; | |
58 void Raster(SkCanvas* canvas, | 53 void Raster(SkCanvas* canvas, |
59 SkPicture::AbortCallback* callback) const override; | 54 SkPicture::AbortCallback* callback) const override; |
60 void AsValueInto(const gfx::Rect& visual_rect, | 55 void AsValueInto(const gfx::Rect& visual_rect, |
61 base::trace_event::TracedValue* array) const override; | 56 base::trace_event::TracedValue* array) const override; |
62 size_t ExternalMemoryUsage() const override; | 57 size_t ExternalMemoryUsage() const override; |
63 | 58 |
64 int ApproximateOpCount() const { return 0; } | 59 int ApproximateOpCount() const { return 0; } |
65 }; | 60 }; |
66 | 61 |
67 } // namespace cc | 62 } // namespace cc |
68 | 63 |
69 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ | 64 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ |
OLD | NEW |