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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 2212493002: Convert SkAutoTUnref<SkData> to sk_sp<SkData>. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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/SkWriteBuffer.cpp ('k') | src/image/SkImage.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 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 #include "SkGrPriv.h" 10 #include "SkGrPriv.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 (pixelRef->info().height() != bm.info().height())) { 191 (pixelRef->info().height() != bm.info().height())) {
192 return nullptr; 192 return nullptr;
193 } 193 }
194 194
195 PixelRef_GrYUVProvider provider(pixelRef); 195 PixelRef_GrYUVProvider provider(pixelRef);
196 196
197 return provider.refAsTexture(ctx, desc, !bm.isVolatile()); 197 return provider.refAsTexture(ctx, desc, !bm.isVolatile());
198 } 198 }
199 199
200 static GrTexture* load_etc1_texture(GrContext* ctx, const SkBitmap &bm, GrSurfac eDesc desc) { 200 static GrTexture* load_etc1_texture(GrContext* ctx, const SkBitmap &bm, GrSurfac eDesc desc) {
201 SkAutoTUnref<SkData> data(bm.pixelRef()->refEncodedData()); 201 sk_sp<SkData> data(bm.pixelRef()->refEncodedData());
202 if (!data) { 202 if (!data) {
203 return nullptr; 203 return nullptr;
204 } 204 }
205 205
206 const void* startOfTexData; 206 const void* startOfTexData;
207 desc.fConfig = GrIsCompressedTextureDataSupported(ctx, data, bm.width(), bm. height(), 207 desc.fConfig = GrIsCompressedTextureDataSupported(ctx, data.get(), bm.width( ), bm.height(),
208 &startOfTexData); 208 &startOfTexData);
209 if (kUnknown_GrPixelConfig == desc.fConfig) { 209 if (kUnknown_GrPixelConfig == desc.fConfig) {
210 return nullptr; 210 return nullptr;
211 } 211 }
212 212
213 return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, startOf TexData, 0); 213 return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, startOf TexData, 0);
214 } 214 }
215 215
216 GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bitmap) { 216 GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bitmap) {
217 GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps()); 217 GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps());
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 SkErrorInternals::SetError( kInvalidPaint_SkError, 772 SkErrorInternals::SetError( kInvalidPaint_SkError,
773 "Sorry, I don't understand the filtering " 773 "Sorry, I don't understand the filtering "
774 "mode you asked for. Falling back to " 774 "mode you asked for. Falling back to "
775 "MIPMaps."); 775 "MIPMaps.");
776 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 776 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
777 break; 777 break;
778 778
779 } 779 }
780 return textureFilterMode; 780 return textureFilterMode;
781 } 781 }
OLDNEW
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698