diff options
author | Brian Salomon <bsalomon@google.com> | 2014-10-07 15:07:38 -0400 |
---|---|---|
committer | Brian Salomon <bsalomon@google.com> | 2014-10-07 15:07:38 -0400 |
commit | 9323b8b8e16df4adcd63ee8496a6382e8df535c9 (patch) | |
tree | 12ff0bd9f07193593b7db1d52ef2fe0478c00aeb /src/effects/gradients | |
parent | 65be97d1a1eb5923b078bd1e7ec1e7da6e6427e2 (diff) |
Revert "GrResourceCache2 manages scratch texture."
This reverts commit d14e1a27643125bfef37fa0ed314b64c1fae22b7.
Diffstat (limited to 'src/effects/gradients')
-rw-r--r-- | src/effects/gradients/SkGradientShader.cpp | 7 |
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, ¶ms)); + GrTexture* texture = GrLockAndRefCachedBitmapTexture(ctx, bitmap, ¶ms); 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); } |