Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index d9435459f1900ad23487cd2a5309c1b6152f958b..e81abdbae475c14a3d99a17afed4601b6cad2a53 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -369,9 +369,9 @@ |
return ctx->isTextureInCache(desc, cacheID, params); |
} |
-GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, |
- const SkBitmap& bitmap, |
- const GrTextureParams* params) { |
+GrTexture* GrLockAndRefCachedBitmapTexture(GrContext* ctx, |
+ const SkBitmap& bitmap, |
+ const GrTextureParams* params) { |
GrTexture* result = NULL; |
bool cache = !bitmap.isVolatile(); |
@@ -395,6 +395,13 @@ |
bitmap.width(), bitmap.height()); |
} |
return result; |
+} |
+ |
+void GrUnlockAndUnrefCachedBitmapTexture(GrTexture* texture) { |
+ SkASSERT(texture->getContext()); |
+ |
+ texture->getContext()->unlockScratchTexture(texture); |
+ texture->unref(); |
} |
/////////////////////////////////////////////////////////////////////////////// |