diff --git a/gfx/thebes/GLContextProviderCGL.mm b/gfx/thebes/GLContextProviderCGL.mm index cda582aa955..61ae7c143d8 100644 --- a/gfx/thebes/GLContextProviderCGL.mm +++ b/gfx/thebes/GLContextProviderCGL.mm @@ -46,6 +46,7 @@ #include "gfxPlatform.h" #include "gfxFailure.h" #include "prenv.h" +#include "mozilla/Preferences.h" namespace mozilla { namespace gl { @@ -558,16 +559,21 @@ GLContextProviderCGL::CreateOffscreen(const gfxIntSize& aSize, const ContextFormat& aFormat) { nsRefPtr glContext; - - glContext = CreateOffscreenPBufferContext(aSize, aFormat); - if (glContext && - glContext->Init()) + + NS_ENSURE_TRUE(Preferences::GetRootBranch(), nsnull); + const bool preferFBOs = Preferences::GetBool("cgl.prefer-fbo", false); + if (!preferFBOs) { - glContext->mOffscreenSize = aSize; - glContext->mOffscreenActualSize = aSize; + glContext = CreateOffscreenPBufferContext(aSize, aFormat); + if (glContext && + glContext->Init()) + { + glContext->mOffscreenSize = aSize; + glContext->mOffscreenActualSize = aSize; - return glContext.forget(); - } + return glContext.forget(); + } + } // try a FBO as second choice glContext = CreateOffscreenFBOContext(aSize, aFormat); diff --git a/gfx/thebes/GLContextProviderWGL.cpp b/gfx/thebes/GLContextProviderWGL.cpp index 69ae5f1256a..768cbd0df67 100644 --- a/gfx/thebes/GLContextProviderWGL.cpp +++ b/gfx/thebes/GLContextProviderWGL.cpp @@ -48,6 +48,8 @@ #include "prenv.h" +#include "mozilla/Preferences.h" + namespace mozilla { namespace gl { @@ -616,7 +618,10 @@ GLContextProviderWGL::CreateOffscreen(const gfxIntSize& aSize, // Always try to create a pbuffer context first, because we // want the context isolation. - if (sWGLLibrary.fCreatePbuffer && + NS_ENSURE_TRUE(Preferences::GetRootBranch(), nsnull); + const bool preferFBOs = Preferences::GetBool("wgl.prefer-fbo", false); + if (!preferFBOs && + sWGLLibrary.fCreatePbuffer && sWGLLibrary.fChoosePixelFormat) { glContext = CreatePBufferOffscreenContext(aSize, aFormat);