| 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; | |
| 18 | |
| 19 namespace cc { | 17 namespace cc { |
| 20 | 18 |
| 21 class CC_EXPORT TransformDisplayItem : public DisplayItem { | 19 class CC_EXPORT TransformDisplayItem : public DisplayItem { |
| 22 public: | 20 public: |
| 23 explicit TransformDisplayItem(const gfx::Transform& transform); | 21 explicit TransformDisplayItem(const gfx::Transform& transform); |
| 24 ~TransformDisplayItem() override; | 22 ~TransformDisplayItem() override; |
| 25 | 23 |
| 26 void Raster(SkCanvas* canvas, | 24 void Raster(PaintCanvas* canvas, |
| 27 SkPicture::AbortCallback* callback) const override; | 25 PaintRecord::AbortCallback* callback) const override; |
| 28 void AsValueInto(const gfx::Rect& visual_rect, | 26 void AsValueInto(const gfx::Rect& visual_rect, |
| 29 base::trace_event::TracedValue* array) const override; | 27 base::trace_event::TracedValue* array) const override; |
| 30 | 28 |
| 31 size_t ExternalMemoryUsage() const { return 0; } | 29 size_t ExternalMemoryUsage() const { return 0; } |
| 32 int ApproximateOpCount() const { return 1; } | 30 int ApproximateOpCount() const { return 1; } |
| 33 | 31 |
| 34 private: | 32 private: |
| 35 void SetNew(const gfx::Transform& transform); | 33 void SetNew(const gfx::Transform& transform); |
| 36 | 34 |
| 37 gfx::Transform transform_; | 35 gfx::Transform transform_; |
| 38 }; | 36 }; |
| 39 | 37 |
| 40 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { | 38 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { |
| 41 public: | 39 public: |
| 42 EndTransformDisplayItem(); | 40 EndTransformDisplayItem(); |
| 43 ~EndTransformDisplayItem() override; | 41 ~EndTransformDisplayItem() override; |
| 44 | 42 |
| 45 static std::unique_ptr<EndTransformDisplayItem> Create() { | 43 static std::unique_ptr<EndTransformDisplayItem> Create() { |
| 46 return base::MakeUnique<EndTransformDisplayItem>(); | 44 return base::MakeUnique<EndTransformDisplayItem>(); |
| 47 } | 45 } |
| 48 | 46 |
| 49 void Raster(SkCanvas* canvas, | 47 void Raster(PaintCanvas* canvas, |
| 50 SkPicture::AbortCallback* callback) const override; | 48 PaintRecord::AbortCallback* callback) const override; |
| 51 void AsValueInto(const gfx::Rect& visual_rect, | 49 void AsValueInto(const gfx::Rect& visual_rect, |
| 52 base::trace_event::TracedValue* array) const override; | 50 base::trace_event::TracedValue* array) const override; |
| 53 | 51 |
| 54 int ApproximateOpCount() const { return 0; } | 52 int ApproximateOpCount() const { return 0; } |
| 55 }; | 53 }; |
| 56 | 54 |
| 57 } // namespace cc | 55 } // namespace cc |
| 58 | 56 |
| 59 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ | 57 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ |
| OLD | NEW |