Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: cc/playback/transform_display_item.h

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-existing SkPicture::uniqueID() when dealing with display items without SkPictures Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 const gfx::Rect& canvas_target_playback_rect, 29 const gfx::Rect& canvas_target_playback_rect,
33 SkPicture::AbortCallback* callback) const override; 30 SkPicture::AbortCallback* callback) const override;
34 void AsValueInto(const gfx::Rect& visual_rect, 31 void AsValueInto(const gfx::Rect& visual_rect,
35 base::trace_event::TracedValue* array) const override; 32 base::trace_event::TracedValue* array) const override;
36 size_t ExternalMemoryUsage() const override; 33 size_t ExternalMemoryUsage() const override;
37 34
38 int ApproximateOpCount() const { return 1; } 35 int ApproximateOpCount() const { return 1; }
39 bool IsSuitableForGpuRasterization() const { return true; } 36 bool IsSuitableForGpuRasterization() const { return true; }
40 37
41 private: 38 private:
42 void SetNew(const gfx::Transform& transform); 39 void SetNew(const gfx::Transform& transform);
43 40
44 gfx::Transform transform_; 41 gfx::Transform transform_;
45 }; 42 };
46 43
47 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { 44 class CC_EXPORT EndTransformDisplayItem : public DisplayItem {
48 public: 45 public:
49 EndTransformDisplayItem(); 46 EndTransformDisplayItem();
50 explicit EndTransformDisplayItem(const proto::DisplayItem& proto); 47 explicit EndTransformDisplayItem(const proto::DisplayItem& proto);
51 ~EndTransformDisplayItem() override; 48 ~EndTransformDisplayItem() override;
52 49
53 static std::unique_ptr<EndTransformDisplayItem> Create() { 50 static std::unique_ptr<EndTransformDisplayItem> Create() {
54 return base::WrapUnique(new EndTransformDisplayItem()); 51 return base::WrapUnique(new EndTransformDisplayItem());
55 } 52 }
56 53
57 void ToProtobuf(proto::DisplayItem* proto, 54 void ToProtobuf(proto::DisplayItem* proto) const override;
58 ImageSerializationProcessor* image_serialization_processor)
59 const override;
60 void Raster(SkCanvas* canvas, 55 void Raster(SkCanvas* canvas,
61 const gfx::Rect& canvas_target_playback_rect, 56 const gfx::Rect& canvas_target_playback_rect,
62 SkPicture::AbortCallback* callback) const override; 57 SkPicture::AbortCallback* callback) const override;
63 void AsValueInto(const gfx::Rect& visual_rect, 58 void AsValueInto(const gfx::Rect& visual_rect,
64 base::trace_event::TracedValue* array) const override; 59 base::trace_event::TracedValue* array) const override;
65 size_t ExternalMemoryUsage() const override; 60 size_t ExternalMemoryUsage() const override;
66 61
67 int ApproximateOpCount() const { return 0; } 62 int ApproximateOpCount() const { return 0; }
68 bool IsSuitableForGpuRasterization() const { return true; } 63 bool IsSuitableForGpuRasterization() const { return true; }
69 }; 64 };
70 65
71 } // namespace cc 66 } // namespace cc
72 67
73 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_ 68 #endif // CC_PLAYBACK_TRANSFORM_DISPLAY_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698