Index: src/effects/gradients/SkGradientShader.cpp |
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp |
index 89b323a701d2c3cdc09a20114b1457e3375a3736..cb9cfff43f7524184ae91df42f7fd9c09a5ba3fc 100644 |
--- a/src/effects/gradients/SkGradientShader.cpp |
+++ b/src/effects/gradients/SkGradientShader.cpp |
@@ -1164,15 +1164,10 @@ GrGradientEffect::GrGradientEffect(GrContext* ctx, |
fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture()); |
fTextureAccess.reset(fAtlas->getTexture(), params); |
} else { |
- GrTexture* texture = GrLockAndRefCachedBitmapTexture(ctx, bitmap, ¶ms); |
+ SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(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); |
} |