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 13 matching lines...) Expand all Loading... |
24 void FloatClipDisplayItem::SetNew(const gfx::RectF& clip_rect) { | 24 void FloatClipDisplayItem::SetNew(const gfx::RectF& clip_rect) { |
25 clip_rect_ = clip_rect; | 25 clip_rect_ = clip_rect; |
26 } | 26 } |
27 | 27 |
28 void FloatClipDisplayItem::Raster(SkCanvas* canvas, | 28 void FloatClipDisplayItem::Raster(SkCanvas* canvas, |
29 SkPicture::AbortCallback* callback) const { | 29 SkPicture::AbortCallback* callback) const { |
30 canvas->save(); | 30 canvas->save(); |
31 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); | 31 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); |
32 } | 32 } |
33 | 33 |
34 void FloatClipDisplayItem::AsValueInto( | |
35 const gfx::Rect& visual_rect, | |
36 base::trace_event::TracedValue* array) const { | |
37 array->AppendString(base::StringPrintf( | |
38 "FloatClipDisplayItem rect: [%s] visualRect: [%s]", | |
39 clip_rect_.ToString().c_str(), visual_rect.ToString().c_str())); | |
40 } | |
41 | |
42 EndFloatClipDisplayItem::EndFloatClipDisplayItem() | 34 EndFloatClipDisplayItem::EndFloatClipDisplayItem() |
43 : DisplayItem(END_FLOAT_CLIP) {} | 35 : DisplayItem(END_FLOAT_CLIP) {} |
44 | 36 |
45 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { | 37 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { |
46 } | 38 } |
47 | 39 |
48 void EndFloatClipDisplayItem::Raster( | 40 void EndFloatClipDisplayItem::Raster( |
49 SkCanvas* canvas, | 41 SkCanvas* canvas, |
50 SkPicture::AbortCallback* callback) const { | 42 SkPicture::AbortCallback* callback) const { |
51 canvas->restore(); | 43 canvas->restore(); |
52 } | 44 } |
53 | 45 |
54 void EndFloatClipDisplayItem::AsValueInto( | |
55 const gfx::Rect& visual_rect, | |
56 base::trace_event::TracedValue* array) const { | |
57 array->AppendString( | |
58 base::StringPrintf("EndFloatClipDisplayItem visualRect: [%s]", | |
59 visual_rect.ToString().c_str())); | |
60 } | |
61 | |
62 } // namespace cc | 46 } // namespace cc |
OLD | NEW |