Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 608883003: GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: remove todo Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 43197dedf208fef30b5c5d5cbcca1457cdacd809..861e829237b72464e305f120b49a661874b4d6c5 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;
}
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698