Chromium Code Reviews| Index: src/gpu/SkGr.cpp |
| diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
| index f1c4d2052d5a4b585f308da369e90fa424c28799..e104f27367f86e9ae33d24630ac5f9c299b9f5ce 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); |
|
robertphillips
2015/02/05 20:43:49
result && ?
bsalomon
2015/02/06 15:27:27
Done.
|
| + if (optionalKey.isValid()) { |
| + SkAssertResult(ctx->addResourceToCache(optionalKey, result)); |
| } |
| return result; |
| } |