diff options
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r-- | src/gpu/SkGr.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 3334095a95..9aa79618a2 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -407,9 +407,11 @@ static GrTexture* load_yuv_texture(GrContext* ctx, const GrUniqueKey& optionalKe bool needsExactTexture = (yuvDesc.fWidth != yuvInfo.fSize[0].fWidth) || (yuvDesc.fHeight != yuvInfo.fSize[0].fHeight); - yuvTextures[i].reset(ctx->textureProvider()->refScratchTexture(yuvDesc, - needsExactTexture ? GrTextureProvider::kExact_ScratchTexMatch : - GrTextureProvider::kApprox_ScratchTexMatch)); + if (needsExactTexture) { + yuvTextures[i].reset(ctx->textureProvider()->createTexture(yuvDesc, true)); + } else { + yuvTextures[i].reset(ctx->textureProvider()->createApproxTexture(yuvDesc)); + } if (!yuvTextures[i] || !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight, yuvDesc.fConfig, planes[i], yuvInfo.fRowBytes[i])) { |