Index: src/effects/gradients/SkGradientShader.cpp |
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp |
index 39f0e75df1904f3e8e8c2cf265af370abaacc281..d25873b438502c84bd3a880f84524ed6bff21df0 100644 |
--- a/src/effects/gradients/SkGradientShader.cpp |
+++ b/src/effects/gradients/SkGradientShader.cpp |
@@ -1164,10 +1164,15 @@ |
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); |
} |