From 9ec075366ed94802a142fc5e948d19a774f85b43 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Fri, 22 Jun 2012 12:01:30 +0000 Subject: Altered GrDrawState to always ref texture and render target http://codereview.appspot.com/6251049/ git-svn-id: http://skia.googlecode.com/svn/trunk@4298 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/gpu/GrContext.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include/gpu') diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 71263d4351..122baf1358 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -772,7 +772,6 @@ private: static int PaintStageVertexLayoutBits( const GrPaint& paint, const bool hasTexCoords[GrPaint::kTotalStages]); - }; /** @@ -834,8 +833,13 @@ public: } ~GrAutoScratchTexture() { + this->reset(); + } + + void reset() { if (NULL != fContext) { fContext->unlockTexture(fEntry); + fEntry.reset(); } } @@ -843,10 +847,8 @@ public: const GrTextureDesc& desc, GrContext::ScratchTexMatch match = GrContext::kApprox_ScratchTexMatch) { - if (NULL != fContext) { - fContext->unlockTexture(fEntry); - fEntry.reset(); - } + this->reset(); + fContext = context; if (NULL != fContext) { fEntry = fContext->lockScratchTexture(desc, match); -- cgit v1.2.3