diff options
author | 2014-10-08 08:40:09 -0700 | |
---|---|---|
committer | 2014-10-08 08:40:09 -0700 | |
commit | bcf0a52d4f4221b158e68a06ba0c4cc4db011060 (patch) | |
tree | 6ad69163908f2fa15a6f857b16c1df7c12216ed1 /src/effects/SkPerlinNoiseShader.cpp | |
parent | b82b9d577e9d811d88de89594bbd6e697892616c (diff) |
GrResourceCache2 manages scratch texture.
BUG=skia:2889
Review URL: https://codereview.chromium.org/608883003
Diffstat (limited to 'src/effects/SkPerlinNoiseShader.cpp')
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 43197dedf2..861e829237 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -997,10 +997,10 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint& SkPerlinNoiseShader::PaintingData* paintingData = SkNEW_ARGS(PaintingData, (fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix)); - GrTexture* permutationsTexture = GrLockAndRefCachedBitmapTexture( - context, paintingData->getPermutationsBitmap(), NULL); - GrTexture* noiseTexture = GrLockAndRefCachedBitmapTexture( - context, paintingData->getNoiseBitmap(), NULL); + SkAutoTUnref<GrTexture> permutationsTexture( + GrRefCachedBitmapTexture(context, paintingData->getPermutationsBitmap(), NULL)); + SkAutoTUnref<GrTexture> noiseTexture( + GrRefCachedBitmapTexture(context, paintingData->getNoiseBitmap(), NULL)); SkMatrix m = context->getMatrix(); m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1); @@ -1016,17 +1016,6 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint& 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; } |