| 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_DRAWING_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
| 6 #define CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 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 "third_party/skia/include/core/SkRefCnt.h" | 15 #include "third_party/skia/include/core/SkRefCnt.h" |
| 16 #include "ui/gfx/geometry/point_f.h" | 16 #include "ui/gfx/geometry/point_f.h" |
| 17 | 17 |
| 18 class SkCanvas; | 18 class SkCanvas; |
| 19 class SkPicture; | 19 class SkPicture; |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 class ClientPictureCache; | |
| 23 | 22 |
| 24 class CC_EXPORT DrawingDisplayItem : public DisplayItem { | 23 class CC_EXPORT DrawingDisplayItem : public DisplayItem { |
| 25 public: | 24 public: |
| 26 DrawingDisplayItem(); | 25 DrawingDisplayItem(); |
| 27 explicit DrawingDisplayItem(sk_sp<const SkPicture> picture); | 26 explicit DrawingDisplayItem(sk_sp<const SkPicture> picture); |
| 28 explicit DrawingDisplayItem(const proto::DisplayItem& proto, | |
| 29 ClientPictureCache* client_picture_cache, | |
| 30 std::vector<uint32_t>* used_engine_picture_ids); | |
| 31 explicit DrawingDisplayItem(const DrawingDisplayItem& item); | 27 explicit DrawingDisplayItem(const DrawingDisplayItem& item); |
| 32 ~DrawingDisplayItem() override; | 28 ~DrawingDisplayItem() override; |
| 33 | 29 |
| 34 void ToProtobuf(proto::DisplayItem* proto) const override; | |
| 35 sk_sp<const SkPicture> GetPicture() const override; | 30 sk_sp<const SkPicture> GetPicture() const override; |
| 36 void Raster(SkCanvas* canvas, | 31 void Raster(SkCanvas* canvas, |
| 37 SkPicture::AbortCallback* callback) const override; | 32 SkPicture::AbortCallback* callback) const override; |
| 38 void AsValueInto(const gfx::Rect& visual_rect, | 33 void AsValueInto(const gfx::Rect& visual_rect, |
| 39 base::trace_event::TracedValue* array) const override; | 34 base::trace_event::TracedValue* array) const override; |
| 40 | 35 |
| 41 size_t ExternalMemoryUsage() const; | 36 size_t ExternalMemoryUsage() const; |
| 42 int ApproximateOpCount() const; | 37 int ApproximateOpCount() const; |
| 43 | 38 |
| 44 void CloneTo(DrawingDisplayItem* item) const; | 39 void CloneTo(DrawingDisplayItem* item) const; |
| 45 | 40 |
| 46 private: | 41 private: |
| 47 void SetNew(sk_sp<const SkPicture> picture); | 42 void SetNew(sk_sp<const SkPicture> picture); |
| 48 | 43 |
| 49 sk_sp<const SkPicture> picture_; | 44 sk_sp<const SkPicture> picture_; |
| 50 }; | 45 }; |
| 51 | 46 |
| 52 } // namespace cc | 47 } // namespace cc |
| 53 | 48 |
| 54 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ | 49 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
| OLD | NEW |