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

Side by Side Diff: src/core/SkCanvas.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/SkBitmapDevice.cpp ('k') | src/core/SkDevice.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 fDeviceCMDirty = true; 1307 fDeviceCMDirty = true;
1308 delete layer; 1308 delete layer;
1309 } else { 1309 } else {
1310 // we're at the root 1310 // we're at the root
1311 SkASSERT(layer == (void*)fDeviceCMStorage); 1311 SkASSERT(layer == (void*)fDeviceCMStorage);
1312 layer->~DeviceCM(); 1312 layer->~DeviceCM();
1313 } 1313 }
1314 } 1314 }
1315 } 1315 }
1316 1316
1317 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 1317 sk_sp<SkSurface> SkCanvas::makeSurface(const SkImageInfo& info, const SkSurfaceP rops* props) {
1318 if (nullptr == props) { 1318 if (nullptr == props) {
1319 props = &fProps; 1319 props = &fProps;
1320 } 1320 }
1321 return this->onNewSurface(info, *props); 1321 return this->onNewSurface(info, *props);
1322 } 1322 }
1323 1323
1324 SkSurface* SkCanvas::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) { 1324 sk_sp<SkSurface> SkCanvas::onNewSurface(const SkImageInfo& info, const SkSurface Props& props) {
1325 SkBaseDevice* dev = this->getDevice(); 1325 SkBaseDevice* dev = this->getDevice();
1326 return dev ? dev->newSurface(info, props) : nullptr; 1326 return dev ? dev->makeSurface(info, props) : nullptr;
1327 } 1327 }
1328 1328
1329 SkImageInfo SkCanvas::imageInfo() const { 1329 SkImageInfo SkCanvas::imageInfo() const {
1330 SkBaseDevice* dev = this->getDevice(); 1330 SkBaseDevice* dev = this->getDevice();
1331 if (dev) { 1331 if (dev) {
1332 return dev->imageInfo(); 1332 return dev->imageInfo();
1333 } else { 1333 } else {
1334 return SkImageInfo::MakeUnknown(0, 0); 1334 return SkImageInfo::MakeUnknown(0, 0);
1335 } 1335 }
1336 } 1336 }
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 } 3036 }
3037 3037
3038 if (matrix) { 3038 if (matrix) {
3039 canvas->concat(*matrix); 3039 canvas->concat(*matrix);
3040 } 3040 }
3041 } 3041 }
3042 3042
3043 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3043 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3044 fCanvas->restoreToCount(fSaveCount); 3044 fCanvas->restoreToCount(fSaveCount);
3045 } 3045 }
3046
3047 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3048 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3049 return this->makeSurface(info, props).release();
3050 }
3051 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698