aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-10 21:56:21 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-10 21:56:21 +0000
commitc4ff22a2965616629765b8ffe0e58f6d05f92fa3 (patch)
tree9dd436794873b40426d8ba9a7aa1e8e2fab02006
parentbbce8b29bd0d30ee0b1155ae72023e779cbdce9b (diff)
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
-rw-r--r--src/gpu/GrContext.cpp5
1 files 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;