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/float_clip_display_item.h" | 5 #include "cc/playback/float_clip_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/gfx_conversions.h" | 10 #include "cc/proto/gfx_conversions.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 void FloatClipDisplayItem::Raster(SkCanvas* canvas, | 45 void FloatClipDisplayItem::Raster(SkCanvas* canvas, |
46 const gfx::Rect& canvas_target_playback_rect, | 46 const gfx::Rect& canvas_target_playback_rect, |
47 SkPicture::AbortCallback* callback) const { | 47 SkPicture::AbortCallback* callback) const { |
48 canvas->save(); | 48 canvas->save(); |
49 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); | 49 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); |
50 } | 50 } |
51 | 51 |
52 void FloatClipDisplayItem::AsValueInto( | 52 void FloatClipDisplayItem::AsValueInto( |
| 53 const gfx::Rect& visual_rect, |
53 base::trace_event::TracedValue* array) const { | 54 base::trace_event::TracedValue* array) const { |
54 array->AppendString(base::StringPrintf("FloatClipDisplayItem rect: [%s]", | 55 array->AppendString(base::StringPrintf( |
55 clip_rect_.ToString().c_str())); | 56 "FloatClipDisplayItem rect: [%s] visualRect: [%s]", |
| 57 clip_rect_.ToString().c_str(), visual_rect.ToString().c_str())); |
56 } | 58 } |
57 | 59 |
58 EndFloatClipDisplayItem::EndFloatClipDisplayItem() { | 60 EndFloatClipDisplayItem::EndFloatClipDisplayItem() { |
59 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, | 61 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, |
60 0 /* external_memory_usage */); | 62 0 /* external_memory_usage */); |
61 } | 63 } |
62 | 64 |
63 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { | 65 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { |
64 } | 66 } |
65 | 67 |
66 void EndFloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { | 68 void EndFloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
67 proto->set_type(proto::DisplayItem::Type_EndFloatClip); | 69 proto->set_type(proto::DisplayItem::Type_EndFloatClip); |
68 } | 70 } |
69 | 71 |
70 void EndFloatClipDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { | 72 void EndFloatClipDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
71 DCHECK_EQ(proto::DisplayItem::Type_EndFloatClip, proto.type()); | 73 DCHECK_EQ(proto::DisplayItem::Type_EndFloatClip, proto.type()); |
72 } | 74 } |
73 | 75 |
74 void EndFloatClipDisplayItem::Raster( | 76 void EndFloatClipDisplayItem::Raster( |
75 SkCanvas* canvas, | 77 SkCanvas* canvas, |
76 const gfx::Rect& canvas_target_playback_rect, | 78 const gfx::Rect& canvas_target_playback_rect, |
77 SkPicture::AbortCallback* callback) const { | 79 SkPicture::AbortCallback* callback) const { |
78 canvas->restore(); | 80 canvas->restore(); |
79 } | 81 } |
80 | 82 |
81 void EndFloatClipDisplayItem::AsValueInto( | 83 void EndFloatClipDisplayItem::AsValueInto( |
| 84 const gfx::Rect& visual_rect, |
82 base::trace_event::TracedValue* array) const { | 85 base::trace_event::TracedValue* array) const { |
83 array->AppendString("EndFloatClipDisplayItem"); | 86 array->AppendString( |
| 87 base::StringPrintf("EndFloatClipDisplayItem visualRect: [%s]", |
| 88 visual_rect.ToString().c_str())); |
84 } | 89 } |
85 | 90 |
86 } // namespace cc | 91 } // namespace cc |
OLD | NEW |