| 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 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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(SkCanvas* canvas, |
| 35 SkPicture::AbortCallback* callback) const override; | 35 SkPicture::AbortCallback* callback) const override; |
| 36 void AsValueInto(const gfx::Rect& visual_rect, | |
| 37 base::trace_event::TracedValue* array) const override; | |
| 38 | 36 |
| 39 size_t ExternalMemoryUsage() const { | 37 size_t ExternalMemoryUsage() const { |
| 40 // TODO(pdr): Include color_filter's memory here. | 38 // TODO(pdr): Include color_filter's memory here. |
| 41 return 0; | 39 return 0; |
| 42 } | 40 } |
| 43 int ApproximateOpCount() const { return 1; } | 41 int ApproximateOpCount() const { return 1; } |
| 44 | 42 |
| 43 uint8_t alpha() const { return alpha_; } |
| 44 SkBlendMode xfermode() const { return xfermode_; } |
| 45 bool has_bounds() const { return has_bounds_; } |
| 46 const SkRect& bounds() const { return bounds_; } |
| 47 |
| 45 private: | 48 private: |
| 46 void SetNew(uint8_t alpha, | 49 void SetNew(uint8_t alpha, |
| 47 SkBlendMode xfermode, | 50 SkBlendMode xfermode, |
| 48 SkRect* bounds, | 51 SkRect* bounds, |
| 49 sk_sp<SkColorFilter> color_filter, | 52 sk_sp<SkColorFilter> color_filter, |
| 50 bool lcd_text_requires_opaque_layer); | 53 bool lcd_text_requires_opaque_layer); |
| 51 | 54 |
| 52 uint8_t alpha_; | 55 uint8_t alpha_; |
| 53 SkBlendMode xfermode_; | 56 SkBlendMode xfermode_; |
| 54 bool has_bounds_; | 57 bool has_bounds_; |
| 55 SkRect bounds_; | 58 SkRect bounds_; |
| 56 sk_sp<SkColorFilter> color_filter_; | 59 sk_sp<SkColorFilter> color_filter_; |
| 57 bool lcd_text_requires_opaque_layer_; | 60 bool lcd_text_requires_opaque_layer_; |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 class CC_EXPORT EndCompositingDisplayItem : public DisplayItem { | 63 class CC_EXPORT EndCompositingDisplayItem : public DisplayItem { |
| 61 public: | 64 public: |
| 62 EndCompositingDisplayItem(); | 65 EndCompositingDisplayItem(); |
| 63 ~EndCompositingDisplayItem() override; | 66 ~EndCompositingDisplayItem() override; |
| 64 | 67 |
| 65 static std::unique_ptr<EndCompositingDisplayItem> Create() { | 68 static std::unique_ptr<EndCompositingDisplayItem> Create() { |
| 66 return base::MakeUnique<EndCompositingDisplayItem>(); | 69 return base::MakeUnique<EndCompositingDisplayItem>(); |
| 67 } | 70 } |
| 68 | 71 |
| 69 void Raster(SkCanvas* canvas, | 72 void Raster(SkCanvas* canvas, |
| 70 SkPicture::AbortCallback* callback) const override; | 73 SkPicture::AbortCallback* callback) const override; |
| 71 void AsValueInto(const gfx::Rect& visual_rect, | |
| 72 base::trace_event::TracedValue* array) const override; | |
| 73 | 74 |
| 74 int ApproximateOpCount() const { return 0; } | 75 int ApproximateOpCount() const { return 0; } |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace cc | 78 } // namespace cc |
| 78 | 79 |
| 79 #endif // CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ | 80 #endif // CC_PLAYBACK_COMPOSITING_DISPLAY_ITEM_H_ |
| OLD | NEW |