From c4ff22a2965616629765b8ffe0e58f6d05f92fa3 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Thu, 10 Nov 2011 21:56:21 +0000 Subject: Hold onto scratch texture until end of readRenderTargetPixels Review URL: http://codereview.appspot.com/5369065/ git-svn-id: http://skia.googlecode.com/svn/trunk@2664 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/GrContext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index da26bc6fa6..12b8b07a0e 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1707,8 +1707,8 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target, // also a texture (e.g. FBO 0 in GL) return false; } - // we draw to a scratch texture if any of these conversion are applied + GrAutoScratchTexture ast; if (flipY || swapRAndB || alphaConversion) { GrAssert(NULL != src); if (swapRAndB) { @@ -1723,7 +1723,8 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target, width, height, { config } }; - GrAutoScratchTexture ast(this, desc); + + ast.set(this, desc); GrTexture* texture = ast.texture(); if (!texture) { return false; -- cgit v1.2.3