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

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

Issue 1407793002: Add protobuf serialization to DisplayItemList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blimp_display2
Patch Set: Rebased Created 5 years, 1 month 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();
23 ~ClipDisplayItem() override; 23 ~ClipDisplayItem() override;
24 24
25 void SetNew(gfx::Rect clip_rect, 25 void SetNew(gfx::Rect clip_rect,
26 const std::vector<SkRRect>& rounded_clip_rects); 26 const std::vector<SkRRect>& rounded_clip_rects);
27 27
28 void ToProtobuf(proto::DisplayItem* proto) override;
29 void FromProtobuf(const proto::DisplayItem& proto) override;
28 void Raster(SkCanvas* canvas, 30 void Raster(SkCanvas* canvas,
29 const gfx::Rect& canvas_target_playback_rect, 31 const gfx::Rect& canvas_target_playback_rect,
30 SkPicture::AbortCallback* callback) const override; 32 SkPicture::AbortCallback* callback) const override;
31 void AsValueInto(base::trace_event::TracedValue* array) const override; 33 void AsValueInto(base::trace_event::TracedValue* array) const override;
32 void ProcessForBounds( 34 void ProcessForBounds(
33 DisplayItemListBoundsCalculator* calculator) const override; 35 DisplayItemListBoundsCalculator* calculator) const override;
34 36
35 private: 37 private:
36 gfx::Rect clip_rect_; 38 gfx::Rect clip_rect_;
37 std::vector<SkRRect> rounded_clip_rects_; 39 std::vector<SkRRect> rounded_clip_rects_;
38 }; 40 };
39 41
40 class CC_EXPORT EndClipDisplayItem : public DisplayItem { 42 class CC_EXPORT EndClipDisplayItem : public DisplayItem {
41 public: 43 public:
42 EndClipDisplayItem(); 44 EndClipDisplayItem();
43 ~EndClipDisplayItem() override; 45 ~EndClipDisplayItem() override;
44 46
47 void ToProtobuf(proto::DisplayItem* proto) override;
48 void FromProtobuf(const proto::DisplayItem& proto) override;
45 void Raster(SkCanvas* canvas, 49 void Raster(SkCanvas* canvas,
46 const gfx::Rect& canvas_target_playback_rect, 50 const gfx::Rect& canvas_target_playback_rect,
47 SkPicture::AbortCallback* callback) const override; 51 SkPicture::AbortCallback* callback) const override;
48 void AsValueInto(base::trace_event::TracedValue* array) const override; 52 void AsValueInto(base::trace_event::TracedValue* array) const override;
49 void ProcessForBounds( 53 void ProcessForBounds(
50 DisplayItemListBoundsCalculator* calculator) const override; 54 DisplayItemListBoundsCalculator* calculator) const override;
51 }; 55 };
52 56
53 } // namespace cc 57 } // namespace cc
54 58
55 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ 59 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/playback/clip_display_item.cc » ('j') | cc/playback/clip_display_item.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698