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

Side by Side Diff: cc/resources/compositing_display_item.h

Issue 952123002: Add layer bounds to compositing_dislay_item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: !!bounds! Created 5 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/blink/web_display_item_list_impl.cc ('k') | cc/resources/compositing_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_RESOURCES_COMPOSITING_DISPLAY_ITEM_H_ 5 #ifndef CC_RESOURCES_COMPOSITING_DISPLAY_ITEM_H_
6 #define CC_RESOURCES_COMPOSITING_DISPLAY_ITEM_H_ 6 #define CC_RESOURCES_COMPOSITING_DISPLAY_ITEM_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/resources/display_item.h" 10 #include "cc/resources/display_item.h"
11 #include "skia/ext/refptr.h" 11 #include "skia/ext/refptr.h"
12 #include "third_party/skia/include/core/SkColorFilter.h" 12 #include "third_party/skia/include/core/SkColorFilter.h"
13 #include "third_party/skia/include/core/SkRect.h"
13 #include "third_party/skia/include/core/SkXfermode.h" 14 #include "third_party/skia/include/core/SkXfermode.h"
14 #include "ui/gfx/geometry/rect_f.h" 15 #include "ui/gfx/geometry/rect_f.h"
15 16
16 class SkCanvas; 17 class SkCanvas;
17 class SkDrawPictureCallback; 18 class SkDrawPictureCallback;
18 19
19 namespace cc { 20 namespace cc {
20 21
21 class CC_EXPORT CompositingDisplayItem : public DisplayItem { 22 class CC_EXPORT CompositingDisplayItem : public DisplayItem {
22 public: 23 public:
23 ~CompositingDisplayItem() override; 24 ~CompositingDisplayItem() override;
24 25
25 static scoped_ptr<CompositingDisplayItem> Create( 26 static scoped_ptr<CompositingDisplayItem> Create(
26 float opacity, 27 float opacity,
27 SkXfermode::Mode xfermode, 28 SkXfermode::Mode xfermode,
29 SkRect* bounds,
28 skia::RefPtr<SkColorFilter> color_filter) { 30 skia::RefPtr<SkColorFilter> color_filter) {
29 return make_scoped_ptr( 31 return make_scoped_ptr(
30 new CompositingDisplayItem(opacity, xfermode, color_filter)); 32 new CompositingDisplayItem(opacity, xfermode, bounds, color_filter));
31 } 33 }
32 34
33 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override; 35 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override;
34 36
35 bool IsSuitableForGpuRasterization() const override; 37 bool IsSuitableForGpuRasterization() const override;
36 int ApproximateOpCount() const override; 38 int ApproximateOpCount() const override;
37 size_t PictureMemoryUsage() const override; 39 size_t PictureMemoryUsage() const override;
38 void AsValueInto(base::trace_event::TracedValue* array) const override; 40 void AsValueInto(base::trace_event::TracedValue* array) const override;
39 41
40 protected: 42 protected:
41 CompositingDisplayItem(float opacity, 43 CompositingDisplayItem(float opacity,
42 SkXfermode::Mode, 44 SkXfermode::Mode,
45 SkRect* bounds,
43 skia::RefPtr<SkColorFilter>); 46 skia::RefPtr<SkColorFilter>);
44 47
45 private: 48 private:
46 float opacity_; 49 float opacity_;
47 SkXfermode::Mode xfermode_; 50 SkXfermode::Mode xfermode_;
51 bool has_bounds_;
52 SkRect bounds_;
48 skia::RefPtr<SkColorFilter> color_filter_; 53 skia::RefPtr<SkColorFilter> color_filter_;
49 }; 54 };
50 55
51 class CC_EXPORT EndCompositingDisplayItem : public DisplayItem { 56 class CC_EXPORT EndCompositingDisplayItem : public DisplayItem {
52 public: 57 public:
53 ~EndCompositingDisplayItem() override; 58 ~EndCompositingDisplayItem() override;
54 59
55 static scoped_ptr<EndCompositingDisplayItem> Create() { 60 static scoped_ptr<EndCompositingDisplayItem> Create() {
56 return make_scoped_ptr(new EndCompositingDisplayItem()); 61 return make_scoped_ptr(new EndCompositingDisplayItem());
57 } 62 }
58 63
59 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override; 64 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override;
60 65
61 bool IsSuitableForGpuRasterization() const override; 66 bool IsSuitableForGpuRasterization() const override;
62 int ApproximateOpCount() const override; 67 int ApproximateOpCount() const override;
63 size_t PictureMemoryUsage() const override; 68 size_t PictureMemoryUsage() const override;
64 void AsValueInto(base::trace_event::TracedValue* array) const override; 69 void AsValueInto(base::trace_event::TracedValue* array) const override;
65 70
66 protected: 71 protected:
67 EndCompositingDisplayItem(); 72 EndCompositingDisplayItem();
68 }; 73 };
69 74
70 } // namespace cc 75 } // namespace cc
71 76
72 #endif // CC_RESOURCES_COMPOSITING_DISPLAY_ITEM_H_ 77 #endif // CC_RESOURCES_COMPOSITING_DISPLAY_ITEM_H_
OLDNEW
« no previous file with comments | « cc/blink/web_display_item_list_impl.cc ('k') | cc/resources/compositing_display_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698