Index: src/core/SkImageCacherator.cpp |
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp |
index dcc5c676f672e546be136263c50d14b9efdaadf3..f5ec5e34771e002b3463d499a379d7d62bbfad6b 100644 |
--- a/src/core/SkImageCacherator.cpp |
+++ b/src/core/SkImageCacherator.cpp |
@@ -162,13 +162,6 @@ bool SkImageCacherator::lockAsBitmap(SkBitmap* bitmap) { |
////////////////////////////////////////////////////////////////////////////////////////////////// |
#if SK_SUPPORT_GPU |
-static void make_texture_desc(const SkImageInfo& info, GrSurfaceDesc* desc) { |
- desc->fFlags = kNone_GrSurfaceFlags; |
- desc->fWidth = info.width(); |
- desc->fHeight = info.height(); |
- desc->fConfig = SkImageInfo2GrPixelConfig(info); |
- desc->fSampleCnt = 0; |
-} |
static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrSurfaceDesc desc) { |
const void* rawStart; |
@@ -229,9 +222,6 @@ GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, SkImageUsageType usa |
GrMakeKeyFromImageID(&key, fUniqueID, SkIRect::MakeWH(fInfo.width(), fInfo.height()), |
*ctx->caps(), usage); |
- GrSurfaceDesc desc; |
- make_texture_desc(fInfo, &desc); |
- |
// 1. Check the cache for a pre-existing one |
if (GrTexture* tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(key)) { |
return tex; |
@@ -246,6 +236,8 @@ GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, SkImageUsageType usa |
} |
} |
+ const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(fInfo); |
+ |
// 3. Ask the generator to return a compressed form that the GPU might support |
SkAutoTUnref<SkData> data(this->refEncoded()); |
if (data) { |