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

Side by Side Diff: src/utils/SkPictureUtils.cpp

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « src/utils/SkNWayCanvas.cpp ('k') | src/utils/SkProxyCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 SkTDArray<SkPixelRef*> array; 198 SkTDArray<SkPixelRef*> array;
199 PixelRefSet prset(&array); 199 PixelRefSet prset(&array);
200 200
201 GatherPixelRefDevice device(SkScalarCeilToInt(pict->cullRect().width()), 201 GatherPixelRefDevice device(SkScalarCeilToInt(pict->cullRect().width()),
202 SkScalarCeilToInt(pict->cullRect().height()), 202 SkScalarCeilToInt(pict->cullRect().height()),
203 &prset); 203 &prset);
204 SkNoSaveLayerCanvas canvas(&device); 204 SkNoSaveLayerCanvas canvas(&device);
205 205
206 canvas.clipRect(area, SkRegion::kIntersect_Op, false); 206 canvas.clipRect(area);
207 canvas.drawPicture(pict); 207 canvas.drawPicture(pict);
208 208
209 SkData* data = NULL; 209 SkData* data = NULL;
210 int count = array.count(); 210 int count = array.count();
211 if (count > 0) { 211 if (count > 0) {
212 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) ); 212 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) );
213 } 213 }
214 return data; 214 return data;
215 } 215 }
216 216
(...skipping 11 matching lines...) Expand all
228 if (pict->fBBH.get()) { 228 if (pict->fBBH.get()) {
229 byteCount += pict->fBBH->bytesUsed(); 229 byteCount += pict->fBBH->bytesUsed();
230 } 230 }
231 MeasureRecords visitor; 231 MeasureRecords visitor;
232 for (unsigned curOp = 0; curOp < pict->fRecord->count(); curOp++) { 232 for (unsigned curOp = 0; curOp < pict->fRecord->count(); curOp++) {
233 byteCount += pict->fRecord->visit<size_t>(curOp, visitor); 233 byteCount += pict->fRecord->visit<size_t>(curOp, visitor);
234 } 234 }
235 235
236 return byteCount; 236 return byteCount;
237 } 237 }
OLDNEW
« no previous file with comments | « src/utils/SkNWayCanvas.cpp ('k') | src/utils/SkProxyCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698