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

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

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git merge origin/master Created 4 years, 6 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_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 11
12 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
13 #include "cc/playback/display_item.h" 13 #include "cc/playback/display_item.h"
14 #include "third_party/skia/include/core/SkRefCnt.h" 14 #include "third_party/skia/include/core/SkRefCnt.h"
15 #include "ui/gfx/geometry/point_f.h" 15 #include "ui/gfx/geometry/point_f.h"
16 16
17 class SkCanvas; 17 class SkCanvas;
18 class SkPicture; 18 class SkPicture;
19 19
20 namespace cc { 20 namespace cc {
21 class ImageSerializationProcessor; 21 class ClientPictureCache;
22 class EnginePictureCache;
22 23
23 class CC_EXPORT DrawingDisplayItem : public DisplayItem { 24 class CC_EXPORT DrawingDisplayItem : public DisplayItem {
24 public: 25 public:
25 DrawingDisplayItem(); 26 DrawingDisplayItem();
26 explicit DrawingDisplayItem(sk_sp<const SkPicture> picture); 27 explicit DrawingDisplayItem(sk_sp<const SkPicture> picture);
27 explicit DrawingDisplayItem( 28 explicit DrawingDisplayItem(const proto::DisplayItem& proto,
28 const proto::DisplayItem& proto, 29 ClientPictureCache* client_picture_cache);
29 ImageSerializationProcessor* image_serialization_processor);
30 explicit DrawingDisplayItem(const DrawingDisplayItem& item); 30 explicit DrawingDisplayItem(const DrawingDisplayItem& item);
31 ~DrawingDisplayItem() override; 31 ~DrawingDisplayItem() override;
32 32
33 void ToProtobuf(proto::DisplayItem* proto, 33 void ToProtobuf(proto::DisplayItem* proto) const override;
34 ImageSerializationProcessor* image_serialization_processor) 34 void MarkForRegistrationEngine(
35 const override; 35 EnginePictureCache* engine_picture_cache) const override;
36 void MarkForUnregistrationEngine(
37 EnginePictureCache* engine_picture_cache) const override;
36 void Raster(SkCanvas* canvas, 38 void Raster(SkCanvas* canvas,
37 const gfx::Rect& canvas_playback_rect, 39 const gfx::Rect& canvas_playback_rect,
38 SkPicture::AbortCallback* callback) const override; 40 SkPicture::AbortCallback* callback) const override;
39 void AsValueInto(const gfx::Rect& visual_rect, 41 void AsValueInto(const gfx::Rect& visual_rect,
40 base::trace_event::TracedValue* array) const override; 42 base::trace_event::TracedValue* array) const override;
41 size_t ExternalMemoryUsage() const override; 43 size_t ExternalMemoryUsage() const override;
42 44
43 int ApproximateOpCount() const; 45 int ApproximateOpCount() const;
44 46
45 void CloneTo(DrawingDisplayItem* item) const; 47 void CloneTo(DrawingDisplayItem* item) const;
46 48
47 private: 49 private:
48 void SetNew(sk_sp<const SkPicture> picture); 50 void SetNew(sk_sp<const SkPicture> picture);
49 51
50 sk_sp<const SkPicture> picture_; 52 sk_sp<const SkPicture> picture_;
51 }; 53 };
52 54
53 } // namespace cc 55 } // namespace cc
54 56
55 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ 57 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698