| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 clip_path_ = clip_path; | 27 clip_path_ = clip_path; |
| 28 antialias_ = antialias; | 28 antialias_ = antialias; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void ClipPathDisplayItem::Raster(SkCanvas* canvas, | 31 void ClipPathDisplayItem::Raster(SkCanvas* canvas, |
| 32 SkPicture::AbortCallback* callback) const { | 32 SkPicture::AbortCallback* callback) const { |
| 33 canvas->save(); | 33 canvas->save(); |
| 34 canvas->clipPath(clip_path_, antialias_); | 34 canvas->clipPath(clip_path_, antialias_); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ClipPathDisplayItem::AsValueInto( | |
| 38 const gfx::Rect& visual_rect, | |
| 39 base::trace_event::TracedValue* array) const { | |
| 40 array->AppendString(base::StringPrintf( | |
| 41 "ClipPathDisplayItem length: %d visualRect: [%s]", | |
| 42 clip_path_.countPoints(), visual_rect.ToString().c_str())); | |
| 43 } | |
| 44 | |
| 45 EndClipPathDisplayItem::EndClipPathDisplayItem() : DisplayItem(END_CLIP_PATH) {} | 37 EndClipPathDisplayItem::EndClipPathDisplayItem() : DisplayItem(END_CLIP_PATH) {} |
| 46 | 38 |
| 47 EndClipPathDisplayItem::~EndClipPathDisplayItem() { | 39 EndClipPathDisplayItem::~EndClipPathDisplayItem() { |
| 48 } | 40 } |
| 49 | 41 |
| 50 void EndClipPathDisplayItem::Raster( | 42 void EndClipPathDisplayItem::Raster( |
| 51 SkCanvas* canvas, | 43 SkCanvas* canvas, |
| 52 SkPicture::AbortCallback* callback) const { | 44 SkPicture::AbortCallback* callback) const { |
| 53 canvas->restore(); | 45 canvas->restore(); |
| 54 } | 46 } |
| 55 | 47 |
| 56 void EndClipPathDisplayItem::AsValueInto( | |
| 57 const gfx::Rect& visual_rect, | |
| 58 base::trace_event::TracedValue* array) const { | |
| 59 array->AppendString( | |
| 60 base::StringPrintf("EndClipPathDisplayItem visualRect: [%s]", | |
| 61 visual_rect.ToString().c_str())); | |
| 62 } | |
| 63 | |
| 64 } // namespace cc | 48 } // namespace cc |
| OLD | NEW |