Index: src/effects/SkPerlinNoiseShader.cpp |
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp |
index 2668728366de24cfe5b90972dac601732d782f8c..88e6caddb9d6ee6f4f2aec32a505b59c10de08bf 100644 |
--- a/src/effects/SkPerlinNoiseShader.cpp |
+++ b/src/effects/SkPerlinNoiseShader.cpp |
@@ -996,10 +996,10 @@ |
SkPerlinNoiseShader::PaintingData* paintingData = |
SkNEW_ARGS(PaintingData, (fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix)); |
- SkAutoTUnref<GrTexture> permutationsTexture( |
- GrRefCachedBitmapTexture(context, paintingData->getPermutationsBitmap(), NULL)); |
- SkAutoTUnref<GrTexture> noiseTexture( |
- GrRefCachedBitmapTexture(context, paintingData->getNoiseBitmap(), NULL)); |
+ GrTexture* permutationsTexture = GrLockAndRefCachedBitmapTexture( |
+ context, paintingData->getPermutationsBitmap(), NULL); |
+ GrTexture* noiseTexture = GrLockAndRefCachedBitmapTexture( |
+ context, paintingData->getNoiseBitmap(), NULL); |
SkMatrix m = context->getMatrix(); |
m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1); |
@@ -1015,6 +1015,17 @@ |
SkDELETE(paintingData); |
*fp = NULL; |
} |
+ |
+ // Unlock immediately, this is not great, but we don't have a way of |
+ // knowing when else to unlock it currently. TODO: Remove this when |
+ // unref becomes the unlock replacement for all types of textures. |
+ if (permutationsTexture) { |
+ GrUnlockAndUnrefCachedBitmapTexture(permutationsTexture); |
+ } |
+ if (noiseTexture) { |
+ GrUnlockAndUnrefCachedBitmapTexture(noiseTexture); |
+ } |
+ |
return true; |
} |