Bug 615976 - Fix ResizeOffscreenFBO to attempt resize without AA if resize with AA failed - r=bjacob

This commit is contained in:
Jeff Gilbert 2011-10-19 15:09:57 -04:00
parent e7fc88c724
commit 56378bd370
4 changed files with 18 additions and 7 deletions

View File

@ -6,7 +6,6 @@ conformance/misc/uninitialized-test.html
conformance/programs/gl-get-active-attribute.html
conformance/reading/read-pixels-test.html
conformance/renderbuffers/framebuffer-object-attachment.html
conformance/renderbuffers/renderbuffer-initialization.html
conformance/textures/texture-mips.html
conformance/uniforms/gl-uniform-bool.html
conformance/more/functions/copyTexImage2D.html

View File

@ -1018,7 +1018,7 @@ PRUint32 TiledTextureImage::GetTileCount()
}
bool
GLContext::ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO)
GLContext::ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO, const bool aDisableAA)
{
if (!IsOffscreenSizeAllowed(aSize))
return false;
@ -1035,7 +1035,7 @@ GLContext::ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO)
if (!useDrawMSFBO && !aUseReadFBO)
return true;
if (!useDrawMSFBO)
if (!useDrawMSFBO || aDisableAA)
samples = 0;
const bool firstTime = (mOffscreenDrawFBO == 0 && mOffscreenReadFBO == 0);

View File

@ -1321,7 +1321,16 @@ protected:
// helper to create/resize an offscreen FBO,
// for offscreen implementations that use FBOs.
bool ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO);
bool ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO, const bool aDisableAA);
bool ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO) {
if (ResizeOffscreenFBO(aSize, aUseReadFBO, false))
return true;
if (!mCreationFormat.samples)
return false;
printf("ResizeOffscreenFBO failed with AA, retrying without...\n");
return ResizeOffscreenFBO(aSize, aUseReadFBO, true);
}
void DeleteOffscreenFBO();
GLuint mOffscreenDrawFBO;
GLuint mOffscreenReadFBO;

View File

@ -1073,7 +1073,7 @@ GLContextEGL::ResizeOffscreen(const gfxIntSize& aNewSize)
return false;
}
if (!ResizeOffscreenFBO(aNewSize, false))
if (!ResizeOffscreenFBO(pbsize, false))
return false;
SetOffscreenSize(aNewSize, pbsize);
@ -1120,7 +1120,7 @@ GLContextEGL::ResizeOffscreen(const gfxIntSize& aNewSize)
if (!config) {
return false;
}
if (!ResizeOffscreenFBO(aNewSize, false))
if (!ResizeOffscreenFBO(aNewSize, true))
return false;
mThebesSurface = xsurface;
@ -1130,7 +1130,10 @@ GLContextEGL::ResizeOffscreen(const gfxIntSize& aNewSize)
#endif
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
return ResizeOffscreenPixmapSurface(aNewSize);
if (ResizeOffscreenPixmapSurface(aNewSize)) {
if (ResizeOffscreenFBO(aNewSize, true))
return true;
}
#endif
return ResizeOffscreenFBO(aNewSize, true);