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