| 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 explicit CompositingDisplayItem(const proto::DisplayItem& proto); | 32 explicit CompositingDisplayItem(const proto::DisplayItem& proto); |
| 33 ~CompositingDisplayItem() override; | 33 ~CompositingDisplayItem() override; |
| 34 | 34 |
| 35 void ToProtobuf(proto::DisplayItem* proto) const override; | 35 void ToProtobuf(proto::DisplayItem* proto) const override; |
| 36 void Raster(SkCanvas* canvas, | 36 void Raster(PaintCanvas* canvas, |
| 37 SkPicture::AbortCallback* callback) const override; | 37 PaintRecord::AbortCallback* callback) const override; |
| 38 void AsValueInto(const gfx::Rect& visual_rect, | 38 void AsValueInto(const gfx::Rect& visual_rect, |
| 39 base::trace_event::TracedValue* array) const override; | 39 base::trace_event::TracedValue* array) const override; |
| 40 | 40 |
| 41 size_t ExternalMemoryUsage() const { | 41 size_t ExternalMemoryUsage() const { |
| 42 // TODO(pdr): Include color_filter's memory here. | 42 // TODO(pdr): Include color_filter's memory here. |
| 43 return 0; | 43 return 0; |
| 44 } | 44 } |
| 45 int ApproximateOpCount() const { return 1; } | 45 int ApproximateOpCount() const { return 1; } |
| 46 | 46 |
| 47 private: | 47 private: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 63 public: | 63 public: |
| 64 EndCompositingDisplayItem(); | 64 EndCompositingDisplayItem(); |
| 65 explicit EndCompositingDisplayItem(const proto::DisplayItem& proto); | 65 explicit EndCompositingDisplayItem(const proto::DisplayItem& proto); |
| 66 ~EndCompositingDisplayItem() override; | 66 ~EndCompositingDisplayItem() override; |
| 67 | 67 |
| 68 static std::unique_ptr<EndCompositingDisplayItem> Create() { | 68 static std::unique_ptr<EndCompositingDisplayItem> Create() { |
| 69 return base::MakeUnique<EndCompositingDisplayItem>(); | 69 return base::MakeUnique<EndCompositingDisplayItem>(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void ToProtobuf(proto::DisplayItem* proto) const override; | 72 void ToProtobuf(proto::DisplayItem* proto) const override; |
| 73 void Raster(SkCanvas* canvas, | 73 void Raster(PaintCanvas* canvas, |
| 74 SkPicture::AbortCallback* callback) const override; | 74 PaintRecord::AbortCallback* callback) const override; |
| 75 void AsValueInto(const gfx::Rect& visual_rect, | 75 void AsValueInto(const gfx::Rect& visual_rect, |
| 76 base::trace_event::TracedValue* array) const override; | 76 base::trace_event::TracedValue* array) const override; |
| 77 | 77 |
| 78 int ApproximateOpCount() const { return 0; } | 78 int ApproximateOpCount() const { return 0; } |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace cc | 81 } // namespace cc |
| 82 | 82 |
| 83 #endif // CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ | 83 #endif // CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ |
| OLD | NEW |