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

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

Issue 1123983002: cc: Use a ListContainer for DisplayItemList to reduce allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaylistcontainer: fixdcheck Created 5 years, 7 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/resources/clip_path_display_item.h ('k') | cc/resources/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/resources/clip_path_display_item.h" 5 #include "cc/resources/clip_path_display_item.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/trace_event/trace_event_argument.h" 8 #include "base/trace_event/trace_event_argument.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path, 13 ClipPathDisplayItem::ClipPathDisplayItem() {
14 SkRegion::Op clip_op,
15 bool antialias)
16 : clip_path_(clip_path), clip_op_(clip_op), antialias_(antialias) {
17 } 14 }
18 15
19 ClipPathDisplayItem::~ClipPathDisplayItem() { 16 ClipPathDisplayItem::~ClipPathDisplayItem() {
20 } 17 }
21 18
19 void ClipPathDisplayItem::SetNew(const SkPath& clip_path,
20 SkRegion::Op clip_op,
21 bool antialias) {
22 clip_path_ = clip_path;
23 clip_op_ = clip_op;
24 antialias_ = antialias;
25 }
26
22 void ClipPathDisplayItem::Raster(SkCanvas* canvas, 27 void ClipPathDisplayItem::Raster(SkCanvas* canvas,
23 SkDrawPictureCallback* callback) const { 28 SkDrawPictureCallback* callback) const {
24 canvas->save(); 29 canvas->save();
25 canvas->clipPath(clip_path_, clip_op_, antialias_); 30 canvas->clipPath(clip_path_, clip_op_, antialias_);
26 } 31 }
27 32
28 bool ClipPathDisplayItem::IsSuitableForGpuRasterization() const { 33 bool ClipPathDisplayItem::IsSuitableForGpuRasterization() const {
29 return true; 34 return true;
30 } 35 }
31 36
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 size_t EndClipPathDisplayItem::PictureMemoryUsage() const { 71 size_t EndClipPathDisplayItem::PictureMemoryUsage() const {
67 return 0; 72 return 0;
68 } 73 }
69 74
70 void EndClipPathDisplayItem::AsValueInto( 75 void EndClipPathDisplayItem::AsValueInto(
71 base::trace_event::TracedValue* array) const { 76 base::trace_event::TracedValue* array) const {
72 array->AppendString("EndClipPathDisplayItem"); 77 array->AppendString("EndClipPathDisplayItem");
73 } 78 }
74 79
75 } // namespace cc 80 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/clip_path_display_item.h ('k') | cc/resources/compositing_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698