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

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

Issue 1158553004: cc: Cull DrawingDisplayItems outside of the raster playback rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cull: . Created 5 years, 6 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 "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
(...skipping 11 matching lines...) Expand all
22 clip_path_ = clip_path; 22 clip_path_ = clip_path;
23 clip_op_ = clip_op; 23 clip_op_ = clip_op;
24 antialias_ = antialias; 24 antialias_ = antialias;
25 25
26 size_t memory_usage = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool); 26 size_t memory_usage = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool);
27 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */, 27 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */,
28 memory_usage); 28 memory_usage);
29 } 29 }
30 30
31 void ClipPathDisplayItem::Raster(SkCanvas* canvas, 31 void ClipPathDisplayItem::Raster(SkCanvas* canvas,
32 const gfx::Rect& canvas_target_playback_rect,
32 SkPicture::AbortCallback* callback) const { 33 SkPicture::AbortCallback* callback) const {
33 canvas->save(); 34 canvas->save();
34 canvas->clipPath(clip_path_, clip_op_, antialias_); 35 canvas->clipPath(clip_path_, clip_op_, antialias_);
35 } 36 }
36 37
37 void ClipPathDisplayItem::AsValueInto( 38 void ClipPathDisplayItem::AsValueInto(
38 base::trace_event::TracedValue* array) const { 39 base::trace_event::TracedValue* array) const {
39 array->AppendString(base::StringPrintf("ClipPathDisplayItem length: %d", 40 array->AppendString(base::StringPrintf("ClipPathDisplayItem length: %d",
40 clip_path_.countPoints())); 41 clip_path_.countPoints()));
41 } 42 }
42 43
43 EndClipPathDisplayItem::EndClipPathDisplayItem() { 44 EndClipPathDisplayItem::EndClipPathDisplayItem() {
44 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, 45 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */,
45 0 /* memory_usage */); 46 0 /* memory_usage */);
46 } 47 }
47 48
48 EndClipPathDisplayItem::~EndClipPathDisplayItem() { 49 EndClipPathDisplayItem::~EndClipPathDisplayItem() {
49 } 50 }
50 51
51 void EndClipPathDisplayItem::Raster(SkCanvas* canvas, 52 void EndClipPathDisplayItem::Raster(
52 SkPicture::AbortCallback* callback) const { 53 SkCanvas* canvas,
54 const gfx::Rect& canvas_target_playback_rect,
55 SkPicture::AbortCallback* callback) const {
53 canvas->restore(); 56 canvas->restore();
54 } 57 }
55 58
56 void EndClipPathDisplayItem::AsValueInto( 59 void EndClipPathDisplayItem::AsValueInto(
57 base::trace_event::TracedValue* array) const { 60 base::trace_event::TracedValue* array) const {
58 array->AppendString("EndClipPathDisplayItem"); 61 array->AppendString("EndClipPathDisplayItem");
59 } 62 }
60 63
61 } // namespace cc 64 } // 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