diff options
author | robertphillips <robertphillips@google.com> | 2014-09-30 06:54:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-30 06:54:17 -0700 |
commit | dbe6074a06efc5fb6883bb5e4f251ed67c8c0ab4 (patch) | |
tree | 9da0008e6fe68fbe2010ad14f5e6c54c7fa5008b /src/gpu/SkGr.cpp | |
parent | 3d398c876440deaab39bbf2a9b881c337e6dc8d4 (diff) |
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
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r-- | src/gpu/SkGr.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index d9435459f1..e81abdbae4 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -369,9 +369,9 @@ bool GrIsBitmapInCache(const GrContext* ctx, 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 @@ GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, 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 |