Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: cc/playback/clip_path_display_item.cc

Issue 2751833007: cc: Move DisplayItem::Raster up to DisplayItemList (Closed)
Patch Set: virtualraster: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/playback/clip_path_display_item.h ('k') | cc/playback/compositing_display_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
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 { 7 namespace cc {
15 8
16 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path, 9 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path,
17 bool antialias) 10 bool antialias)
18 : DisplayItem(CLIP_PATH) { 11 : DisplayItem(CLIP_PATH), clip_path(clip_path), antialias(antialias) {}
19 SetNew(clip_path, antialias);
20 }
21 12
22 ClipPathDisplayItem::~ClipPathDisplayItem() { 13 ClipPathDisplayItem::~ClipPathDisplayItem() = default;
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 14
37 EndClipPathDisplayItem::EndClipPathDisplayItem() : DisplayItem(END_CLIP_PATH) {} 15 EndClipPathDisplayItem::EndClipPathDisplayItem() : DisplayItem(END_CLIP_PATH) {}
38 16
39 EndClipPathDisplayItem::~EndClipPathDisplayItem() { 17 EndClipPathDisplayItem::~EndClipPathDisplayItem() = default;
40 }
41
42 void EndClipPathDisplayItem::Raster(
43 SkCanvas* canvas,
44 SkPicture::AbortCallback* callback) const {
45 canvas->restore();
46 }
47 18
48 } // namespace cc 19 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/clip_path_display_item.h ('k') | cc/playback/compositing_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698