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

Side by Side Diff: src/core/SkPixmap.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « src/core/SkPictureRecord.cpp ('k') | src/core/SkRecorder.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 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 if (dst.width() == this->width() && dst.height() == this->height()) { 252 if (dst.width() == this->width() && dst.height() == this->height()) {
253 return this->readPixels(dst); 253 return this->readPixels(dst);
254 } 254 }
255 255
256 SkBitmap bitmap; 256 SkBitmap bitmap;
257 if (!bitmap.installPixels(*this)) { 257 if (!bitmap.installPixels(*this)) {
258 return false; 258 return false;
259 } 259 }
260 bitmap.setIsVolatile(true); // so we don't try to cache it 260 bitmap.setIsVolatile(true); // so we don't try to cache it
261 261
262 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterDirect(dst.info(), dst.w ritable_addr(), 262 auto surface(SkSurface::MakeRasterDirect(dst.info(), dst.writable_addr(), ds t.rowBytes()));
263 dst.rowBytes()));
264 if (!surface) { 263 if (!surface) {
265 return false; 264 return false;
266 } 265 }
267 266
268 SkPaint paint; 267 SkPaint paint;
269 paint.setFilterQuality(quality); 268 paint.setFilterQuality(quality);
270 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 269 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
271 surface->getCanvas()->drawBitmapRect(bitmap, SkRect::MakeIWH(dst.width(), ds t.height()), 270 surface->getCanvas()->drawBitmapRect(bitmap, SkRect::MakeIWH(dst.width(), ds t.height()),
272 &paint); 271 &paint);
273 return true; 272 return true;
274 } 273 }
275 274
276 //////////////////////////////////////////////////////////////////////////////// ////////////////// 275 //////////////////////////////////////////////////////////////////////////////// //////////////////
277 276
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698