From 19cd0f1813c4050e7604e1c5b9b5c7ca3de85e7b Mon Sep 17 00:00:00 2001 From: bsalomon Date: Mon, 24 Nov 2014 12:19:05 -0800 Subject: 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 --- src/gpu/GrGpu.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gpu/GrGpu.cpp') 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 sb(static_cast( - this->getContext()->getResourceCache2()->findAndRefScratchResource(sbKey))); + SkAutoTUnref sb( + this->getContext()->findAndRefStencilBuffer(rt->width(), rt->height(), rt->numSamples())); if (sb) { rt->setStencilBuffer(sb); bool attached = this->attachStencilBufferToRenderTarget(sb, rt); -- cgit v1.2.3