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

Side by Side Diff: src/lazy/SkDiscardablePixelRef.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) 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/image/SkImage.cpp ('k') | src/pathops/SkOpCoincidence.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 2013 Google Inc. 2 * Copyright 2013 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 "SkDiscardablePixelRef.h" 8 #include "SkDiscardablePixelRef.h"
9 #include "SkDiscardableMemory.h" 9 #include "SkDiscardableMemory.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return false; 130 return false;
131 } 131 }
132 132
133 // Since dst->setInfo() may have changed/fixed-up info, we check from the bi tmap 133 // Since dst->setInfo() may have changed/fixed-up info, we check from the bi tmap
134 SkASSERT(dst->info().colorType() != kUnknown_SkColorType); 134 SkASSERT(dst->info().colorType() != kUnknown_SkColorType);
135 135
136 if (dst->empty()) { // Use a normal pixelref. 136 if (dst->empty()) { // Use a normal pixelref.
137 return dst->tryAllocPixels(); 137 return dst->tryAllocPixels();
138 } 138 }
139 SkAutoTUnref<SkDiscardablePixelRef> ref( 139 SkAutoTUnref<SkDiscardablePixelRef> ref(
140 new SkDiscardablePixelRef(prInfo, autoGenerator.detach(), dst->rowBy tes(), factory)); 140 new SkDiscardablePixelRef(prInfo, autoGenerator.release(), dst->rowB ytes(), factory));
141 dst->setPixelRef(ref, origin.x(), origin.y()); 141 dst->setPixelRef(ref, origin.x(), origin.y());
142 return true; 142 return true;
143 } 143 }
144 144
145 // These are the public API 145 // These are the public API
146 146
147 bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator* generator, SkBitm ap* dst) { 147 bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator* generator, SkBitm ap* dst) {
148 return SkDEPRECATED_InstallDiscardablePixelRef(generator, nullptr, dst, null ptr); 148 return SkDEPRECATED_InstallDiscardablePixelRef(generator, nullptr, dst, null ptr);
149 } 149 }
150 150
151 bool SkDEPRECATED_InstallDiscardablePixelRef(SkData* encoded, SkBitmap* dst) { 151 bool SkDEPRECATED_InstallDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
152 SkImageGenerator* generator = SkImageGenerator::NewFromEncoded(encoded); 152 SkImageGenerator* generator = SkImageGenerator::NewFromEncoded(encoded);
153 return generator ? 153 return generator ?
154 SkDEPRECATED_InstallDiscardablePixelRef(generator, nullptr, dst, nul lptr) : false; 154 SkDEPRECATED_InstallDiscardablePixelRef(generator, nullptr, dst, nul lptr) : false;
155 } 155 }
OLDNEW
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/pathops/SkOpCoincidence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698