| Index: src/gpu/SkGr.cpp
|
| diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
|
| index d9435459f1900ad23487cd2a5309c1b6152f958b..17c5a83382b5c04b47d8d85baae0636ccacead76 100644
|
| --- a/src/gpu/SkGr.cpp
|
| +++ b/src/gpu/SkGr.cpp
|
| @@ -159,7 +159,7 @@ static GrTexture* sk_gr_allocate_texture(GrContext* ctx,
|
| // cache so no one else can find it. Additionally, once unlocked, the
|
| // scratch texture will go to the end of the list for purging so will
|
| // likely be available for this volatile bitmap the next time around.
|
| - result = ctx->lockAndRefScratchTexture(desc, GrContext::kExact_ScratchTexMatch);
|
| + result = ctx->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch);
|
| if (pixels) {
|
| result->writePixels(0, 0, bm.width(), bm.height(), desc.fConfig, pixels, rowBytes);
|
| }
|
| @@ -248,15 +248,15 @@ static GrTexture *load_yuv_texture(GrContext* ctx, bool cache, const GrTexturePa
|
|
|
| GrTextureDesc yuvDesc;
|
| yuvDesc.fConfig = kAlpha_8_GrPixelConfig;
|
| - GrAutoScratchTexture yuvTextures[3];
|
| + SkAutoTUnref<GrTexture> yuvTextures[3];
|
| for (int i = 0; i < 3; ++i) {
|
| yuvDesc.fWidth = yuvSizes[i].fWidth;
|
| yuvDesc.fHeight = yuvSizes[i].fHeight;
|
| - yuvTextures[i].set(ctx, yuvDesc);
|
| - if ((NULL == yuvTextures[i].texture()) ||
|
| - !ctx->writeTexturePixels(yuvTextures[i].texture(),
|
| - 0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
|
| - yuvDesc.fConfig, planes[i], rowBytes[i])) {
|
| + yuvTextures[i].reset(
|
| + ctx->refScratchTexture(yuvDesc, GrContext::kApprox_ScratchTexMatch));
|
| + if (!yuvTextures[i] ||
|
| + !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
|
| + yuvDesc.fConfig, planes[i], rowBytes[i])) {
|
| return NULL;
|
| }
|
| }
|
| @@ -271,7 +271,7 @@ static GrTexture *load_yuv_texture(GrContext* ctx, bool cache, const GrTexturePa
|
| GrRenderTarget* renderTarget = result ? result->asRenderTarget() : NULL;
|
| if (renderTarget) {
|
| SkAutoTUnref<GrFragmentProcessor> yuvToRgbProcessor(GrYUVtoRGBEffect::Create(
|
| - yuvTextures[0].texture(), yuvTextures[1].texture(), yuvTextures[2].texture(),
|
| + yuvTextures[0], yuvTextures[1], yuvTextures[2],
|
| colorSpace));
|
| GrPaint paint;
|
| paint.addColorProcessor(yuvToRgbProcessor);
|
|
|