diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-22 12:01:30 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-22 12:01:30 +0000 |
commit | 9ec075366ed94802a142fc5e948d19a774f85b43 (patch) | |
tree | 036349ff57b4b2a2a00f153cbb9105efd4b673cd /include/gpu | |
parent | 1e4b990679f5c993a8d6e4646a46e12beb6c5cb2 (diff) |
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
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrContext.h | 12 |
1 files changed, 7 insertions, 5 deletions
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); |