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 PaintCanvas; |
danakj
2017/01/20 23:34:14
can u fwd decl a type alias like that?
enne (OOO)
2017/01/24 01:51:28
Oh toooootally <_< *hastily erases it*
| |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 class CC_EXPORT TransformDisplayItem : public DisplayItem { | 21 class CC_EXPORT TransformDisplayItem : public DisplayItem { |
22 public: | 22 public: |
23 explicit TransformDisplayItem(const gfx::Transform& transform); | 23 explicit TransformDisplayItem(const gfx::Transform& transform); |
24 explicit TransformDisplayItem(const proto::DisplayItem& proto); | 24 explicit TransformDisplayItem(const proto::DisplayItem& proto); |
25 ~TransformDisplayItem() override; | 25 ~TransformDisplayItem() override; |
26 | 26 |
27 void ToProtobuf(proto::DisplayItem* proto) const override; | 27 void ToProtobuf(proto::DisplayItem* proto) const override; |
28 void Raster(SkCanvas* canvas, | 28 void Raster(PaintCanvas* canvas, |
29 SkPicture::AbortCallback* callback) const override; | 29 PaintRecord::AbortCallback* callback) const override; |
30 void AsValueInto(const gfx::Rect& visual_rect, | 30 void AsValueInto(const gfx::Rect& visual_rect, |
31 base::trace_event::TracedValue* array) const override; | 31 base::trace_event::TracedValue* array) const override; |
32 | 32 |
33 size_t ExternalMemoryUsage() const { return 0; } | 33 size_t ExternalMemoryUsage() const { return 0; } |
34 int ApproximateOpCount() const { return 1; } | 34 int ApproximateOpCount() const { return 1; } |
35 | 35 |
36 private: | 36 private: |
37 void SetNew(const gfx::Transform& transform); | 37 void SetNew(const gfx::Transform& transform); |
38 | 38 |
39 gfx::Transform transform_; | 39 gfx::Transform transform_; |
40 }; | 40 }; |
41 | 41 |
42 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { | 42 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { |
43 public: | 43 public: |
44 EndTransformDisplayItem(); | 44 EndTransformDisplayItem(); |
45 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); | 45 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); |
46 ~EndTransformDisplayItem() override; | 46 ~EndTransformDisplayItem() override; |
47 | 47 |
48 static std::unique_ptr<EndTransformDisplayItem> Create() { | 48 static std::unique_ptr<EndTransformDisplayItem> Create() { |
49 return base::MakeUnique<EndTransformDisplayItem>(); | 49 return base::MakeUnique<EndTransformDisplayItem>(); |
50 } | 50 } |
51 | 51 |
52 void ToProtobuf(proto::DisplayItem* proto) const override; | 52 void ToProtobuf(proto::DisplayItem* proto) const override; |
53 void Raster(SkCanvas* canvas, | 53 void Raster(PaintCanvas* canvas, |
54 SkPicture::AbortCallback* callback) const override; | 54 PaintRecord::AbortCallback* callback) const override; |
55 void AsValueInto(const gfx::Rect& visual_rect, | 55 void AsValueInto(const gfx::Rect& visual_rect, |
56 base::trace_event::TracedValue* array) const override; | 56 base::trace_event::TracedValue* array) const override; |
57 | 57 |
58 int ApproximateOpCount() const { return 0; } | 58 int ApproximateOpCount() const { return 0; } |
59 }; | 59 }; |
60 | 60 |
61 } // namespace cc | 61 } // namespace cc |
62 | 62 |
63 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ | 63 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ |
OLD | NEW |