OLD | NEW |
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 #include "cc/playback/clip_path_display_item.h" | 5 #include "cc/playback/clip_path_display_item.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.h" |
9 #include "cc/proto/display_item.pb.h" | 9 #include "cc/proto/display_item.pb.h" |
10 #include "cc/proto/skia_conversions.h" | 10 #include "cc/proto/skia_conversions.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 void ClipPathDisplayItem::Raster(SkCanvas* canvas, | 67 void ClipPathDisplayItem::Raster(SkCanvas* canvas, |
68 const gfx::Rect& canvas_target_playback_rect, | 68 const gfx::Rect& canvas_target_playback_rect, |
69 SkPicture::AbortCallback* callback) const { | 69 SkPicture::AbortCallback* callback) const { |
70 canvas->save(); | 70 canvas->save(); |
71 canvas->clipPath(clip_path_, clip_op_, antialias_); | 71 canvas->clipPath(clip_path_, clip_op_, antialias_); |
72 } | 72 } |
73 | 73 |
74 void ClipPathDisplayItem::AsValueInto( | 74 void ClipPathDisplayItem::AsValueInto( |
| 75 const gfx::Rect& visual_rect, |
75 base::trace_event::TracedValue* array) const { | 76 base::trace_event::TracedValue* array) const { |
76 array->AppendString(base::StringPrintf("ClipPathDisplayItem length: %d", | 77 array->AppendString(base::StringPrintf( |
77 clip_path_.countPoints())); | 78 "ClipPathDisplayItem length: %d visualRect: [%s]", |
| 79 clip_path_.countPoints(), visual_rect.ToString().c_str())); |
78 } | 80 } |
79 | 81 |
80 EndClipPathDisplayItem::EndClipPathDisplayItem() { | 82 EndClipPathDisplayItem::EndClipPathDisplayItem() { |
81 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, | 83 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, |
82 0 /* external_memory_usage */); | 84 0 /* external_memory_usage */); |
83 } | 85 } |
84 | 86 |
85 EndClipPathDisplayItem::~EndClipPathDisplayItem() { | 87 EndClipPathDisplayItem::~EndClipPathDisplayItem() { |
86 } | 88 } |
87 | 89 |
88 void EndClipPathDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { | 90 void EndClipPathDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
89 proto->set_type(proto::DisplayItem::Type_EndClipPath); | 91 proto->set_type(proto::DisplayItem::Type_EndClipPath); |
90 } | 92 } |
91 | 93 |
92 void EndClipPathDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { | 94 void EndClipPathDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
93 DCHECK_EQ(proto::DisplayItem::Type_EndClipPath, proto.type()); | 95 DCHECK_EQ(proto::DisplayItem::Type_EndClipPath, proto.type()); |
94 } | 96 } |
95 | 97 |
96 void EndClipPathDisplayItem::Raster( | 98 void EndClipPathDisplayItem::Raster( |
97 SkCanvas* canvas, | 99 SkCanvas* canvas, |
98 const gfx::Rect& canvas_target_playback_rect, | 100 const gfx::Rect& canvas_target_playback_rect, |
99 SkPicture::AbortCallback* callback) const { | 101 SkPicture::AbortCallback* callback) const { |
100 canvas->restore(); | 102 canvas->restore(); |
101 } | 103 } |
102 | 104 |
103 void EndClipPathDisplayItem::AsValueInto( | 105 void EndClipPathDisplayItem::AsValueInto( |
| 106 const gfx::Rect& visual_rect, |
104 base::trace_event::TracedValue* array) const { | 107 base::trace_event::TracedValue* array) const { |
105 array->AppendString("EndClipPathDisplayItem"); | 108 array->AppendString( |
| 109 base::StringPrintf("EndClipPathDisplayItem visualRect: [%s]", |
| 110 visual_rect.ToString().c_str())); |
106 } | 111 } |
107 | 112 |
108 } // namespace cc | 113 } // namespace cc |
OLD | NEW |