Use min of max_texture and max_renderbuffer size when calling fbo_test



git-svn-id: http://skia.googlecode.com/svn/trunk@1110 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index e62949b..7e88ede 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -407,6 +407,8 @@
         }
     }
 
+    GR_GL_GetIntegerv(GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureDimension);
+
     /* The iPhone 4 has a restriction that for an FBO with texture color
        attachment with height <= 8 then the width must be <= height. Here
        we look for such a limitation.
@@ -414,6 +416,8 @@
     fMinRenderTargetHeight = GR_INVAL_GLINT;
     GrGLint maxRenderSize;
     GR_GL_GetIntegerv(GR_GL_MAX_RENDERBUFFER_SIZE, &maxRenderSize);
+    // fbo_test creates FBOs with texture bound to the color attachment
+    maxRenderSize = GrMin(maxRenderSize, fMaxTextureDimension);
 
     if (gPrintStartupSpew) {
         GrPrintf("Small height FBO texture experiments\n");
@@ -456,8 +460,6 @@
         }
     }
     GrAssert(GR_INVAL_GLINT != fMinRenderTargetWidth);
-
-    GR_GL_GetIntegerv(GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureDimension);
 }
 
 GrGpuGL::~GrGpuGL() {