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
This commit is contained in:
bsalomon@google.com 2011-04-11 19:54:04 +00:00
parent 9f2f0a84d5
commit 7aaee005fa

View File

@ -407,6 +407,8 @@ GrGpuGL::GrGpuGL() {
}
}
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 @@ GrGpuGL::GrGpuGL() {
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 @@ GrGpuGL::GrGpuGL() {
}
}
GrAssert(GR_INVAL_GLINT != fMinRenderTargetWidth);
GR_GL_GetIntegerv(GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureDimension);
}
GrGpuGL::~GrGpuGL() {