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

Side by Side Diff: cc/paint/filter_display_item.h

Issue 2748263002: Move cc::DisplayItemList and related classes into cc/paint/ (Closed)
Patch Set: none 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
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_FILTER_DISPLAY_ITEM_H_ 5 #ifndef CC_PAINT_FILTER_DISPLAY_ITEM_H_
6 #define CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ 6 #define CC_PAINT_FILTER_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 "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "cc/base/cc_export.h" 13 #include "cc/paint/display_item.h"
14 #include "cc/output/filter_operations.h" 14 #include "cc/paint/filter_operations.h"
15 #include "cc/playback/display_item.h" 15 #include "cc/paint/paint_export.h"
16 #include "ui/gfx/geometry/rect_f.h" 16 #include "ui/gfx/geometry/rect_f.h"
17 17
18 class SkCanvas; 18 class SkCanvas;
19 19
20 namespace cc { 20 namespace cc {
21 21
22 class CC_EXPORT FilterDisplayItem : public DisplayItem { 22 class CC_PAINT_EXPORT FilterDisplayItem : public DisplayItem {
23 public: 23 public:
24 FilterDisplayItem(const FilterOperations& filters, 24 FilterDisplayItem(const FilterOperations& filters,
25 const gfx::RectF& bounds, 25 const gfx::RectF& bounds,
26 const gfx::PointF& origin); 26 const gfx::PointF& origin);
27 ~FilterDisplayItem() override; 27 ~FilterDisplayItem() override;
28 28
29 void Raster(SkCanvas* canvas, 29 void Raster(SkCanvas* canvas,
30 SkPicture::AbortCallback* callback) const override; 30 SkPicture::AbortCallback* callback) const override;
31 31
32 size_t ExternalMemoryUsage() const { 32 size_t ExternalMemoryUsage() const {
33 // FilterOperations doesn't expose its capacity, but size is probably good 33 // FilterOperations doesn't expose its capacity, but size is probably good
34 // enough. 34 // enough.
35 return filters_.size() * sizeof(filters_.at(0)); 35 return filters_.size() * sizeof(filters_.at(0));
36 } 36 }
37 int ApproximateOpCount() const { return 1; } 37 int ApproximateOpCount() const { return 1; }
38 38
39 const gfx::RectF& bounds() const { return bounds_; } 39 const gfx::RectF& bounds() const { return bounds_; }
40 40
41 private: 41 private:
42 void SetNew(const FilterOperations& filters, 42 void SetNew(const FilterOperations& filters,
43 const gfx::RectF& bounds, 43 const gfx::RectF& bounds,
44 const gfx::PointF& origin); 44 const gfx::PointF& origin);
45 45
46 FilterOperations filters_; 46 FilterOperations filters_;
47 gfx::RectF bounds_; 47 gfx::RectF bounds_;
48 gfx::PointF origin_; 48 gfx::PointF origin_;
49 }; 49 };
50 50
51 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { 51 class CC_PAINT_EXPORT EndFilterDisplayItem : public DisplayItem {
52 public: 52 public:
53 EndFilterDisplayItem(); 53 EndFilterDisplayItem();
54 ~EndFilterDisplayItem() override; 54 ~EndFilterDisplayItem() override;
55 55
56 static std::unique_ptr<EndFilterDisplayItem> Create() { 56 static std::unique_ptr<EndFilterDisplayItem> Create() {
57 return base::MakeUnique<EndFilterDisplayItem>(); 57 return base::MakeUnique<EndFilterDisplayItem>();
58 } 58 }
59 59
60 void Raster(SkCanvas* canvas, 60 void Raster(SkCanvas* canvas,
61 SkPicture::AbortCallback* callback) const override; 61 SkPicture::AbortCallback* callback) const override;
62 62
63 int ApproximateOpCount() const { return 0; } 63 int ApproximateOpCount() const { return 0; }
64 }; 64 };
65 65
66 } // namespace cc 66 } // namespace cc
67 67
68 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ 68 #endif // CC_PAINT_FILTER_DISPLAY_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698