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

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

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 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
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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return NULL; 207 return NULL;
208 } 208 }
209 209
210 SkTDArray<SkPixelRef*> array; 210 SkTDArray<SkPixelRef*> array;
211 PixelRefSet prset(&array); 211 PixelRefSet prset(&array);
212 212
213 GatherPixelRefDevice device(pict->width(), pict->height(), &prset); 213 GatherPixelRefDevice device(pict->width(), pict->height(), &prset);
214 SkNoSaveLayerCanvas canvas(&device); 214 SkNoSaveLayerCanvas canvas(&device);
215 215
216 canvas.clipRect(area, SkRegion::kIntersect_Op, false); 216 canvas.clipRect(area, SkRegion::kIntersect_Op, false);
217 canvas.drawPicture(*pict); 217 canvas.drawPicture(pict);
218 218
219 SkData* data = NULL; 219 SkData* data = NULL;
220 int count = array.count(); 220 int count = array.count();
221 if (count > 0) { 221 if (count > 0) {
222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) ); 222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) );
223 } 223 }
224 return data; 224 return data;
225 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698