Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index f1c4d2052d5a4b585f308da369e90fa424c28799..2209ea465afd8278875756c33c04217eb0834ee0 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -179,17 +179,9 @@ static GrTexture* create_texture_for_bmp(GrContext* ctx, |
GrSurfaceDesc desc, |
const void* pixels, |
size_t rowBytes) { |
- GrTexture* result; |
- if (optionalKey.isValid() || GrPixelConfigIsCompressed(desc.fConfig)) { |
- result = ctx->createTexture(desc, pixels, rowBytes); |
- if (result) { |
- SkAssertResult(ctx->addResourceToCache(optionalKey, result)); |
- } |
- } else { |
- result = ctx->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch); |
- if (pixels && result) { |
- result->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, pixels, rowBytes); |
- } |
+ GrTexture* result = ctx->createTexture(desc, true, pixels, rowBytes); |
+ if (result && optionalKey.isValid()) { |
+ SkAssertResult(ctx->addResourceToCache(optionalKey, result)); |
} |
return result; |
} |