aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2014-10-07 15:07:38 -0400
committerGravatar Brian Salomon <bsalomon@google.com>2014-10-07 15:07:38 -0400
commit9323b8b8e16df4adcd63ee8496a6382e8df535c9 (patch)
tree12ff0bd9f07193593b7db1d52ef2fe0478c00aeb /src/effects/gradients
parent65be97d1a1eb5923b078bd1e7ec1e7da6e6427e2 (diff)
Revert "GrResourceCache2 manages scratch texture."
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index cb9cfff43f..89b323a701 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1164,10 +1164,15 @@ GrGradientEffect::GrGradientEffect(GrContext* ctx,
fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture());
fTextureAccess.reset(fAtlas->getTexture(), params);
} else {
- SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(ctx, bitmap, &params));
+ GrTexture* texture = GrLockAndRefCachedBitmapTexture(ctx, bitmap, &params);
fCoordTransform.reset(kCoordSet, matrix, texture);
fTextureAccess.reset(texture, params);
fYCoord = SK_ScalarHalf;
+
+ // Unlock immediately, this is not great, but we don't have a way of
+ // knowing when else to unlock it currently, so it may get purged from
+ // the cache, but it'll still be ref'd until it's no longer being used.
+ GrUnlockAndUnrefCachedBitmapTexture(texture);
}
this->addTextureAccess(&fTextureAccess);
}