Make all GrContext members that return a texture also ref the texture for the caller.
Review URL: https://codereview.appspot.com/7198049
git-svn-id: http://skia.googlecode.com/svn/trunk@7362 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 527cc9e..0fef7c6 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -295,9 +295,9 @@
if (result.getTexture()) {
resultTex = (GrTexture*) result.getTexture();
} else {
- resultTex = GrLockCachedBitmapTexture(src->getContext(), result, NULL);
- SkSafeRef(resultTex);
- GrUnlockCachedBitmapTexture(resultTex);
+ resultTex = GrLockAndRefCachedBitmapTexture(src->getContext(), result, NULL);
+ SkSafeRef(resultTex); // for the caller
+ GrUnlockAndUnrefCachedBitmapTexture(resultTex);
return resultTex;
}
} else {