OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "cc/playback/clip_path_display_item.h" | |
6 | |
7 #include <stddef.h> | |
8 #include <stdint.h> | |
9 | |
10 #include "base/strings/stringprintf.h" | |
11 #include "base/trace_event/trace_event_argument.h" | |
12 #include "third_party/skia/include/core/SkCanvas.h" | |
13 | |
14 namespace cc { | |
15 | |
16 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path, | |
17 bool antialias) | |
18 : DisplayItem(CLIP_PATH) { | |
19 SetNew(clip_path, antialias); | |
20 } | |
21 | |
22 ClipPathDisplayItem::~ClipPathDisplayItem() { | |
23 } | |
24 | |
25 void ClipPathDisplayItem::SetNew(const SkPath& clip_path, | |
26 bool antialias) { | |
27 clip_path_ = clip_path; | |
28 antialias_ = antialias; | |
29 } | |
30 | |
31 void ClipPathDisplayItem::Raster(SkCanvas* canvas, | |
32 SkPicture::AbortCallback* callback) const { | |
33 canvas->save(); | |
34 canvas->clipPath(clip_path_, antialias_); | |
35 } | |
36 | |
37 EndClipPathDisplayItem::EndClipPathDisplayItem() : DisplayItem(END_CLIP_PATH) {} | |
38 | |
39 EndClipPathDisplayItem::~EndClipPathDisplayItem() { | |
40 } | |
41 | |
42 void EndClipPathDisplayItem::Raster( | |
43 SkCanvas* canvas, | |
44 SkPicture::AbortCallback* callback) const { | |
45 canvas->restore(); | |
46 } | |
47 | |
48 } // namespace cc | |
OLD | NEW |