diff options
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); |