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
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index 3d86d1b..d366953 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -271,7 +271,7 @@
// 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 @@
if (fNPOTTextureSupport) {
fNPOTRenderTargetSupport = fbo_test(fExts, 200, 200);
}
-
+
if (gPrintStartupSpew) {
if (fNPOTTextureSupport) {
GrPrintf("NPOT textures supported\n");
@@ -1053,7 +1053,11 @@
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)