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

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

Issue 2751833007: cc: Move DisplayItem::Raster up to DisplayItemList (Closed)
Patch Set: virtualraster: . Created 3 years, 9 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
« no previous file with comments | « cc/playback/clip_display_item.cc ('k') | cc/playback/clip_path_display_item.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CLIP_PATH_DISPLAY_ITEM_H_ 5 #ifndef CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_
6 #define CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ 6 #define CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory>
11
12 #include "base/memory/ptr_util.h"
13 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
14 #include "cc/playback/display_item.h" 11 #include "cc/playback/display_item.h"
15 #include "third_party/skia/include/core/SkPath.h" 12 #include "third_party/skia/include/core/SkPath.h"
16 13
17 class SkCanvas;
18
19 namespace cc { 14 namespace cc {
20 15
21 class CC_EXPORT ClipPathDisplayItem : public DisplayItem { 16 class CC_EXPORT ClipPathDisplayItem : public DisplayItem {
22 public: 17 public:
23 ClipPathDisplayItem(const SkPath& path, bool antialias); 18 ClipPathDisplayItem(const SkPath& path, bool antialias);
24 ~ClipPathDisplayItem() override; 19 ~ClipPathDisplayItem() override;
25 20
26 void Raster(SkCanvas* canvas,
27 SkPicture::AbortCallback* callback) const override;
28
29 size_t ExternalMemoryUsage() const { 21 size_t ExternalMemoryUsage() const {
30 // The size of SkPath's external storage is not currently accounted for (and 22 // The size of SkPath's external storage is not currently accounted for (and
31 // may well be shared anyway). 23 // may well be shared anyway).
32 return 0; 24 return 0;
33 } 25 }
34 int ApproximateOpCount() const { return 1; } 26 int ApproximateOpCount() const { return 1; }
35 27
36 const SkPath& clip_path() const { return clip_path_; } 28 const SkPath clip_path;
37 29 const bool antialias;
38 private:
39 void SetNew(const SkPath& path, bool antialias);
40
41 SkPath clip_path_;
42 bool antialias_;
43 }; 30 };
44 31
45 class CC_EXPORT EndClipPathDisplayItem : public DisplayItem { 32 class CC_EXPORT EndClipPathDisplayItem : public DisplayItem {
46 public: 33 public:
47 EndClipPathDisplayItem(); 34 EndClipPathDisplayItem();
48 ~EndClipPathDisplayItem() override; 35 ~EndClipPathDisplayItem() override;
49 36
50 static std::unique_ptr<EndClipPathDisplayItem> Create() {
51 return base::MakeUnique<EndClipPathDisplayItem>();
52 }
53
54 void Raster(SkCanvas* canvas,
55 SkPicture::AbortCallback* callback) const override;
56
57 int ApproximateOpCount() const { return 0; } 37 int ApproximateOpCount() const { return 0; }
58 }; 38 };
59 39
60 } // namespace cc 40 } // namespace cc
61 41
62 #endif // CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ 42 #endif // CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_
OLDNEW
« no previous file with comments | « cc/playback/clip_display_item.cc ('k') | cc/playback/clip_path_display_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698