| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 void FloatClipDisplayItem::ToProtobuf( | 39 void FloatClipDisplayItem::ToProtobuf( |
| 40 proto::DisplayItem* proto, | 40 proto::DisplayItem* proto, |
| 41 ImageSerializationProcessor* image_serialization_processor) const { | 41 ImageSerializationProcessor* image_serialization_processor) const { |
| 42 proto->set_type(proto::DisplayItem::Type_FloatClip); | 42 proto->set_type(proto::DisplayItem::Type_FloatClip); |
| 43 | 43 |
| 44 proto::FloatClipDisplayItem* details = proto->mutable_float_clip_item(); | 44 proto::FloatClipDisplayItem* details = proto->mutable_float_clip_item(); |
| 45 RectFToProto(clip_rect_, details->mutable_clip_rect()); | 45 RectFToProto(clip_rect_, details->mutable_clip_rect()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void FloatClipDisplayItem::Raster(SkCanvas* canvas, | 48 void FloatClipDisplayItem::Raster(SkCanvas* canvas, |
| 49 const gfx::Rect& canvas_target_playback_rect, | |
| 50 SkPicture::AbortCallback* callback) const { | 49 SkPicture::AbortCallback* callback) const { |
| 51 canvas->save(); | 50 canvas->save(); |
| 52 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); | 51 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); |
| 53 } | 52 } |
| 54 | 53 |
| 55 void FloatClipDisplayItem::AsValueInto( | 54 void FloatClipDisplayItem::AsValueInto( |
| 56 const gfx::Rect& visual_rect, | 55 const gfx::Rect& visual_rect, |
| 57 base::trace_event::TracedValue* array) const { | 56 base::trace_event::TracedValue* array) const { |
| 58 array->AppendString(base::StringPrintf( | 57 array->AppendString(base::StringPrintf( |
| 59 "FloatClipDisplayItem rect: [%s] visualRect: [%s]", | 58 "FloatClipDisplayItem rect: [%s] visualRect: [%s]", |
| (...skipping 15 matching lines...) Expand all Loading... |
| 75 } | 74 } |
| 76 | 75 |
| 77 void EndFloatClipDisplayItem::ToProtobuf( | 76 void EndFloatClipDisplayItem::ToProtobuf( |
| 78 proto::DisplayItem* proto, | 77 proto::DisplayItem* proto, |
| 79 ImageSerializationProcessor* image_serialization_processor) const { | 78 ImageSerializationProcessor* image_serialization_processor) const { |
| 80 proto->set_type(proto::DisplayItem::Type_EndFloatClip); | 79 proto->set_type(proto::DisplayItem::Type_EndFloatClip); |
| 81 } | 80 } |
| 82 | 81 |
| 83 void EndFloatClipDisplayItem::Raster( | 82 void EndFloatClipDisplayItem::Raster( |
| 84 SkCanvas* canvas, | 83 SkCanvas* canvas, |
| 85 const gfx::Rect& canvas_target_playback_rect, | |
| 86 SkPicture::AbortCallback* callback) const { | 84 SkPicture::AbortCallback* callback) const { |
| 87 canvas->restore(); | 85 canvas->restore(); |
| 88 } | 86 } |
| 89 | 87 |
| 90 void EndFloatClipDisplayItem::AsValueInto( | 88 void EndFloatClipDisplayItem::AsValueInto( |
| 91 const gfx::Rect& visual_rect, | 89 const gfx::Rect& visual_rect, |
| 92 base::trace_event::TracedValue* array) const { | 90 base::trace_event::TracedValue* array) const { |
| 93 array->AppendString( | 91 array->AppendString( |
| 94 base::StringPrintf("EndFloatClipDisplayItem visualRect: [%s]", | 92 base::StringPrintf("EndFloatClipDisplayItem visualRect: [%s]", |
| 95 visual_rect.ToString().c_str())); | 93 visual_rect.ToString().c_str())); |
| 96 } | 94 } |
| 97 | 95 |
| 98 size_t EndFloatClipDisplayItem::ExternalMemoryUsage() const { | 96 size_t EndFloatClipDisplayItem::ExternalMemoryUsage() const { |
| 99 return 0; | 97 return 0; |
| 100 } | 98 } |
| 101 | 99 |
| 102 } // namespace cc | 100 } // namespace cc |
| OLD | NEW |