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

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

Issue 1779263003: Make sp variants for SkData (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.h ('k') | src/core/SkReadBuffer.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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (!this->tryAlloc(info)) { 308 if (!this->tryAlloc(info)) {
309 sk_throw(); 309 sk_throw();
310 } 310 }
311 } 311 }
312 312
313 const SkData* SkAutoPixmapStorage::detachPixelsAsData() { 313 const SkData* SkAutoPixmapStorage::detachPixelsAsData() {
314 if (!fStorage) { 314 if (!fStorage) {
315 return nullptr; 315 return nullptr;
316 } 316 }
317 317
318 const SkData* data = SkData::NewFromMalloc(fStorage, this->getSafeSize()); 318 auto data = SkData::MakeFromMalloc(fStorage, this->getSafeSize());
319 fStorage = nullptr; 319 fStorage = nullptr;
320 this->INHERITED::reset(); 320 this->INHERITED::reset();
321 321
322 return data; 322 return data.release();
323 } 323 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/core/SkReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698