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

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

Issue 1138923005: Remove SK_LEGACY_DRAWPICTURECALLBACK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: analysis_canvas_unittest fix 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/playback/clip_display_item.h ('k') | cc/playback/clip_path_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_display_item.h" 5 #include "cc/playback/clip_display_item.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 15 matching lines...) Expand all
26 26
27 size_t memory_usage = sizeof(gfx::Rect); 27 size_t memory_usage = sizeof(gfx::Rect);
28 for (size_t i = 0; i < rounded_clip_rects_.size(); ++i) { 28 for (size_t i = 0; i < rounded_clip_rects_.size(); ++i) {
29 memory_usage += sizeof(rounded_clip_rects_[i]); 29 memory_usage += sizeof(rounded_clip_rects_[i]);
30 } 30 }
31 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */, 31 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */,
32 memory_usage); 32 memory_usage);
33 } 33 }
34 34
35 void ClipDisplayItem::Raster(SkCanvas* canvas, 35 void ClipDisplayItem::Raster(SkCanvas* canvas,
36 SkDrawPictureCallback* callback) const { 36 SkPicture::AbortCallback* callback) const {
37 canvas->save(); 37 canvas->save();
38 canvas->clipRect(SkRect::MakeXYWH(clip_rect_.x(), clip_rect_.y(), 38 canvas->clipRect(SkRect::MakeXYWH(clip_rect_.x(), clip_rect_.y(),
39 clip_rect_.width(), clip_rect_.height())); 39 clip_rect_.width(), clip_rect_.height()));
40 for (size_t i = 0; i < rounded_clip_rects_.size(); ++i) { 40 for (size_t i = 0; i < rounded_clip_rects_.size(); ++i) {
41 if (rounded_clip_rects_[i].isRect()) { 41 if (rounded_clip_rects_[i].isRect()) {
42 canvas->clipRect(rounded_clip_rects_[i].rect()); 42 canvas->clipRect(rounded_clip_rects_[i].rect());
43 } else { 43 } else {
44 bool antialiased = true; 44 bool antialiased = true;
45 canvas->clipRRect(rounded_clip_rects_[i], SkRegion::kIntersect_Op, 45 canvas->clipRRect(rounded_clip_rects_[i], SkRegion::kIntersect_Op,
46 antialiased); 46 antialiased);
(...skipping 29 matching lines...) Expand all
76 76
77 EndClipDisplayItem::EndClipDisplayItem() { 77 EndClipDisplayItem::EndClipDisplayItem() {
78 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, 78 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */,
79 0 /* memory_usage */); 79 0 /* memory_usage */);
80 } 80 }
81 81
82 EndClipDisplayItem::~EndClipDisplayItem() { 82 EndClipDisplayItem::~EndClipDisplayItem() {
83 } 83 }
84 84
85 void EndClipDisplayItem::Raster(SkCanvas* canvas, 85 void EndClipDisplayItem::Raster(SkCanvas* canvas,
86 SkDrawPictureCallback* callback) const { 86 SkPicture::AbortCallback* callback) const {
87 canvas->restore(); 87 canvas->restore();
88 } 88 }
89 89
90 void EndClipDisplayItem::AsValueInto( 90 void EndClipDisplayItem::AsValueInto(
91 base::trace_event::TracedValue* array) const { 91 base::trace_event::TracedValue* array) const {
92 array->AppendString("EndClipDisplayItem"); 92 array->AppendString("EndClipDisplayItem");
93 } 93 }
94 94
95 } // namespace cc 95 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/clip_display_item.h ('k') | cc/playback/clip_path_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698