Revert of GrResourceCache2 manages scratch texture. (patchset #14 id:260001 of https://codereview.chromium.org/608883003/)
Reason for revert:
Turning bots red:
Nanobench seems to be uniformly failing on Android
(http://108.170.220.21:10117/builders/Perf-Android-Venue8-PowerVR-x86-Release/builds/99/steps/RunNanobench/logs/stdio)
Ubuntu GTX660 32bit is failing in both Debug and Release on GM generation (it appears to be out of memory) (http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Debug/builds/2457/steps/GenerateGMs/logs/stdio)
Original issue's description:
> GrResourceCache2 manages scratch texture.
>
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3d398c876440deaab39bbf2a9b881c337e6dc8d4
R=bsalomon@google.com
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/611383003
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index d943545..e81abdb 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();
@@ -397,6 +397,13 @@
return result;
}
+void GrUnlockAndUnrefCachedBitmapTexture(GrTexture* texture) {
+ SkASSERT(texture->getContext());
+
+ texture->getContext()->unlockScratchTexture(texture);
+ texture->unref();
+}
+
///////////////////////////////////////////////////////////////////////////////
// alphatype is ignore for now, but if GrPixelConfig is expanded to encompass