aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-07 14:51:55 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-07 14:51:55 +0000
commit18908aacf360eaacf5e6a98dd57342adb98cf463 (patch)
tree51d5bd58ae604e18aa780370c44571a54c33ff3f /gpu
parentb89a643b6992d478c0b8bda3abc53f37a87dbd22 (diff)
When we create the GL context and FBO on mac for the GM test also setup the viewport and clear the stencil.
In GrGpuGL::readPixels make sure current rendertarget has been made current in GL before calling glReadPixels git-svn-id: http://skia.googlecode.com/svn/trunk@761 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu')
-rw-r--r--gpu/src/GrGpuGL.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index 3d86d1b5e5..d366953d86 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -271,7 +271,7 @@ GrGpuGL::GrGpuGL() {
// these a preprocess that generate some compile time constants.
// sanity check to make sure we can at least create an FBO from a POT texture
-
+
bool simpleFBOSuccess = fbo_test(fExts, 128, 128);
if (gPrintStartupSpew) {
if (!simpleFBOSuccess) {
@@ -293,7 +293,7 @@ GrGpuGL::GrGpuGL() {
if (fNPOTTextureSupport) {
fNPOTRenderTargetSupport = fbo_test(fExts, 200, 200);
}
-
+
if (gPrintStartupSpew) {
if (fNPOTTextureSupport) {
GrPrintf("NPOT textures supported\n");
@@ -1053,7 +1053,11 @@ bool GrGpuGL::readPixels(int left, int top, int width, int height,
return false;
}
- GrAssert(NULL != fCurrDrawState.fRenderTarget);
+ if (NULL == fCurrDrawState.fRenderTarget) {
+ return false;
+ }
+ flushRenderTarget();
+
const GrIRect& vp = ((GrGLRenderTarget*)fCurrDrawState.fRenderTarget)->viewport();
// Brian says that viewport rects are already upside down (grrrrr)