Chromium Code Reviews| Index: cc/playback/clip_display_item.cc |
| diff --git a/cc/playback/clip_display_item.cc b/cc/playback/clip_display_item.cc |
| index d89566c1e0d685a327e4a4e97bc05c791f38f2e2..f1499e3bcbaa937e44f69539312ab1a872aa5f7a 100644 |
| --- a/cc/playback/clip_display_item.cc |
| +++ b/cc/playback/clip_display_item.cc |
| @@ -17,24 +17,24 @@ |
| namespace cc { |
| -ClipDisplayItem::ClipDisplayItem() { |
| +ClipDisplayItem::ClipDisplayItem( |
| + gfx::Rect clip_rect, |
|
danakj
2015/12/08 19:18:14
This should be const Rect&
|
| + const std::vector<SkRRect>& rounded_clip_rects) { |
| + SetNew(clip_rect, rounded_clip_rects); |
| } |
| -ClipDisplayItem::~ClipDisplayItem() { |
| +ClipDisplayItem::ClipDisplayItem(const proto::DisplayItem& proto) { |
| + FromProtobuf(proto); |
| } |
| void ClipDisplayItem::SetNew(gfx::Rect clip_rect, |
|
danakj
2015/12/08 19:18:14
hm, that should be const Rect&
|
| const std::vector<SkRRect>& rounded_clip_rects) { |
| clip_rect_ = clip_rect; |
| rounded_clip_rects_ = rounded_clip_rects; |
| - |
| - size_t external_memory_usage = |
| - rounded_clip_rects_.capacity() * sizeof(rounded_clip_rects_[0]); |
| - |
| - DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */, |
| - external_memory_usage); |
| } |
| +ClipDisplayItem::~ClipDisplayItem() {} |
| + |
| void ClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
| proto->set_type(proto::DisplayItem::Type_Clip); |
| @@ -104,9 +104,14 @@ void ClipDisplayItem::AsValueInto(const gfx::Rect& visual_rect, |
| array->AppendString(value); |
| } |
| -EndClipDisplayItem::EndClipDisplayItem() { |
| - DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, |
| - 0 /* external_memory_usage */); |
| +size_t ClipDisplayItem::ExternalMemoryUsage() const { |
| + return rounded_clip_rects_.capacity() * sizeof(rounded_clip_rects_[0]); |
| +} |
| + |
| +EndClipDisplayItem::EndClipDisplayItem() {} |
| + |
| +EndClipDisplayItem::EndClipDisplayItem(const proto::DisplayItem& proto) { |
| + FromProtobuf(proto); |
| } |
| EndClipDisplayItem::~EndClipDisplayItem() { |
| @@ -133,4 +138,8 @@ void EndClipDisplayItem::AsValueInto( |
| visual_rect.ToString().c_str())); |
| } |
| +size_t EndClipDisplayItem::ExternalMemoryUsage() const { |
| + return 0; |
| +} |
| + |
| } // namespace cc |