OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_COMPOSITING_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ |
6 #define CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 #include "cc/paint/paint_canvas.h" |
| 16 #include "cc/paint/paint_record.h" |
15 #include "cc/playback/display_item.h" | 17 #include "cc/playback/display_item.h" |
16 #include "third_party/skia/include/core/SkColorFilter.h" | 18 #include "third_party/skia/include/core/SkColorFilter.h" |
17 #include "third_party/skia/include/core/SkRect.h" | 19 #include "third_party/skia/include/core/SkRect.h" |
18 #include "third_party/skia/include/core/SkRefCnt.h" | 20 #include "third_party/skia/include/core/SkRefCnt.h" |
19 #include "ui/gfx/geometry/rect_f.h" | 21 #include "ui/gfx/geometry/rect_f.h" |
20 | 22 |
21 class SkCanvas; | |
22 | |
23 namespace cc { | 23 namespace cc { |
24 | 24 |
25 class CC_EXPORT CompositingDisplayItem : public DisplayItem { | 25 class CC_EXPORT CompositingDisplayItem : public DisplayItem { |
26 public: | 26 public: |
27 CompositingDisplayItem(uint8_t alpha, | 27 CompositingDisplayItem(uint8_t alpha, |
28 SkBlendMode xfermode, | 28 SkBlendMode xfermode, |
29 SkRect* bounds, | 29 SkRect* bounds, |
30 sk_sp<SkColorFilter> color_filter, | 30 sk_sp<SkColorFilter> color_filter, |
31 bool lcd_text_requires_opaque_layer); | 31 bool lcd_text_requires_opaque_layer); |
32 ~CompositingDisplayItem() override; | 32 ~CompositingDisplayItem() override; |
33 | 33 |
34 void Raster(SkCanvas* canvas, | 34 void Raster(PaintCanvas* canvas, |
35 SkPicture::AbortCallback* callback) const override; | 35 PaintRecord::AbortCallback* callback) const override; |
36 void AsValueInto(const gfx::Rect& visual_rect, | 36 void AsValueInto(const gfx::Rect& visual_rect, |
37 base::trace_event::TracedValue* array) const override; | 37 base::trace_event::TracedValue* array) const override; |
38 | 38 |
39 size_t ExternalMemoryUsage() const { | 39 size_t ExternalMemoryUsage() const { |
40 // TODO(pdr): Include color_filter's memory here. | 40 // TODO(pdr): Include color_filter's memory here. |
41 return 0; | 41 return 0; |
42 } | 42 } |
43 int ApproximateOpCount() const { return 1; } | 43 int ApproximateOpCount() const { return 1; } |
44 | 44 |
45 private: | 45 private: |
(...skipping 13 matching lines...) Expand all Loading... |
59 | 59 |
60 class CC_EXPORT EndCompositingDisplayItem : public DisplayItem { | 60 class CC_EXPORT EndCompositingDisplayItem : public DisplayItem { |
61 public: | 61 public: |
62 EndCompositingDisplayItem(); | 62 EndCompositingDisplayItem(); |
63 ~EndCompositingDisplayItem() override; | 63 ~EndCompositingDisplayItem() override; |
64 | 64 |
65 static std::unique_ptr<EndCompositingDisplayItem> Create() { | 65 static std::unique_ptr<EndCompositingDisplayItem> Create() { |
66 return base::MakeUnique<EndCompositingDisplayItem>(); | 66 return base::MakeUnique<EndCompositingDisplayItem>(); |
67 } | 67 } |
68 | 68 |
69 void Raster(SkCanvas* canvas, | 69 void Raster(PaintCanvas* canvas, |
70 SkPicture::AbortCallback* callback) const override; | 70 PaintRecord::AbortCallback* callback) const override; |
71 void AsValueInto(const gfx::Rect& visual_rect, | 71 void AsValueInto(const gfx::Rect& visual_rect, |
72 base::trace_event::TracedValue* array) const override; | 72 base::trace_event::TracedValue* array) const override; |
73 | 73 |
74 int ApproximateOpCount() const { return 0; } | 74 int ApproximateOpCount() const { return 0; } |
75 }; | 75 }; |
76 | 76 |
77 } // namespace cc | 77 } // namespace cc |
78 | 78 |
79 #endif // CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ | 79 #endif // CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ |
OLD | NEW |