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

Unified Diff: src/core/SkBitmapProcShader.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 | « include/gpu/SkGrPixelRef.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 9c900d35f85ae5e30f734e2927321d32676e82bf..a9798b8e24c3d4e816eac484b561ae3d00ef7e67 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -459,9 +459,9 @@ bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
}
GrTextureParams params(tm, textureFilterMode);
- GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, fRawBitmap, &params);
+ SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap, &params));
- if (NULL == texture) {
+ if (!texture) {
SkErrorInternals::SetError( kInternalError_SkError,
"Couldn't convert bitmap to texture.");
return false;
@@ -476,7 +476,6 @@ bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
} else {
*fp = GrSimpleTextureEffect::Create(texture, matrix, params);
}
- GrUnlockAndUnrefCachedBitmapTexture(texture);
return true;
}
« no previous file with comments | « include/gpu/SkGrPixelRef.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698