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

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

Issue 1494223003: cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make ui compile too oops Created 5 years 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_CLIP_DISPLAY_ITEM_H_ 5 #ifndef CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_
6 #define CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ 6 #define CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "cc/playback/display_item.h" 12 #include "cc/playback/display_item.h"
13 #include "third_party/skia/include/core/SkRRect.h" 13 #include "third_party/skia/include/core/SkRRect.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 15
16 class SkCanvas; 16 class SkCanvas;
17 17
18 namespace cc { 18 namespace cc {
19 19
20 class CC_EXPORT ClipDisplayItem : public DisplayItem { 20 class CC_EXPORT ClipDisplayItem : public DisplayItem {
21 public: 21 public:
22 ClipDisplayItem(); 22 ClipDisplayItem(gfx::Rect clip_rect,
23 const std::vector<SkRRect>& rounded_clip_rects);
24 explicit ClipDisplayItem(const proto::DisplayItem& proto);
23 ~ClipDisplayItem() override; 25 ~ClipDisplayItem() override;
24 26
25 void SetNew(gfx::Rect clip_rect, 27 void SetNew(gfx::Rect clip_rect,
vmpstr 2015/12/04 00:43:09 Are the SetNew functions in all of these unused no
26 const std::vector<SkRRect>& rounded_clip_rects); 28 const std::vector<SkRRect>& rounded_clip_rects);
27 29
28 void ToProtobuf(proto::DisplayItem* proto) const override; 30 void ToProtobuf(proto::DisplayItem* proto) const override;
29 void FromProtobuf(const proto::DisplayItem& proto) override; 31 void FromProtobuf(const proto::DisplayItem& proto) override;
30 void Raster(SkCanvas* canvas, 32 void Raster(SkCanvas* canvas,
31 const gfx::Rect& canvas_target_playback_rect, 33 const gfx::Rect& canvas_target_playback_rect,
32 SkPicture::AbortCallback* callback) const override; 34 SkPicture::AbortCallback* callback) const override;
33 void AsValueInto(const gfx::Rect& visual_rect, 35 void AsValueInto(const gfx::Rect& visual_rect,
34 base::trace_event::TracedValue* array) const override; 36 base::trace_event::TracedValue* array) const override;
37 size_t ExternalMemoryUsage() const override;
38 int ApproximateOpCount() const override;
35 39
36 private: 40 private:
37 gfx::Rect clip_rect_; 41 gfx::Rect clip_rect_;
38 std::vector<SkRRect> rounded_clip_rects_; 42 std::vector<SkRRect> rounded_clip_rects_;
39 }; 43 };
40 44
41 class CC_EXPORT EndClipDisplayItem : public DisplayItem { 45 class CC_EXPORT EndClipDisplayItem : public DisplayItem {
42 public: 46 public:
43 EndClipDisplayItem(); 47 EndClipDisplayItem();
48 explicit EndClipDisplayItem(const proto::DisplayItem& proto);
44 ~EndClipDisplayItem() override; 49 ~EndClipDisplayItem() override;
45 50
46 void ToProtobuf(proto::DisplayItem* proto) const override; 51 void ToProtobuf(proto::DisplayItem* proto) const override;
47 void FromProtobuf(const proto::DisplayItem& proto) override; 52 void FromProtobuf(const proto::DisplayItem& proto) override;
48 void Raster(SkCanvas* canvas, 53 void Raster(SkCanvas* canvas,
49 const gfx::Rect& canvas_target_playback_rect, 54 const gfx::Rect& canvas_target_playback_rect,
50 SkPicture::AbortCallback* callback) const override; 55 SkPicture::AbortCallback* callback) const override;
51 void AsValueInto(const gfx::Rect& visual_rect, 56 void AsValueInto(const gfx::Rect& visual_rect,
52 base::trace_event::TracedValue* array) const override; 57 base::trace_event::TracedValue* array) const override;
58 size_t ExternalMemoryUsage() const override;
59 int ApproximateOpCount() const override;
53 }; 60 };
54 61
55 } // namespace cc 62 } // namespace cc
56 63
57 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ 64 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698