OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |