diff options
author | bsalomon <bsalomon@google.com> | 2014-11-24 12:19:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-24 12:19:06 -0800 |
commit | 19cd0f1813c4050e7604e1c5b9b5c7ca3de85e7b (patch) | |
tree | c637ddfec1b517b372e8bf6612672ead4e151816 /src/gpu/GrGpu.cpp | |
parent | 90d0ff013bbd8e5295d1517d41cb408e9d9f4d93 (diff) |
Revert "Use scratch keys for stencil buffers."
This reverts commit 91175f19664a62851da4ca4e0984a7c7c45b258f.
Revert "Cleanup res cache bench and split out into a unit test."
This reverts commit 4e4303f002c5958c6c958e7ba8e49b24c25f0b22.
Revert "rebaselines"
This reverts commit 65ba7b57759bfca60b24bc34dc46fc8caaf146f0.
TBR=tomhudson@google.com
Review URL: https://codereview.chromium.org/752233002
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r-- | src/gpu/GrGpu.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 6b742c4cc3..2bda594b9a 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -13,12 +13,14 @@ #include "GrContext.h" #include "GrDrawTargetCaps.h" #include "GrIndexBuffer.h" -#include "GrResourceCache2.h" #include "GrStencilBuffer.h" #include "GrVertexBuffer.h" //////////////////////////////////////////////////////////////////////////////// +#define DEBUG_INVAL_BUFFER 0xdeadcafe +#define DEBUG_INVAL_START_IDX -1 + GrGpu::GrGpu(GrContext* context) : fResetTimestamp(kExpiredTimestamp+1) , fResetBits(kAll_GrBackendState) @@ -76,9 +78,8 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) { SkASSERT(NULL == rt->getStencilBuffer()); - GrResourceKey sbKey = GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples()); - SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>( - this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey))); + SkAutoTUnref<GrStencilBuffer> sb( + this->getContext()->findAndRefStencilBuffer(rt->width(), rt->height(), rt->numSamples())); if (sb) { rt->setStencilBuffer(sb); bool attached = this->attachStencilBufferToRenderTarget(sb, rt); |