Fix for 686083: Adds method to disable GL implementations

This commit is contained in:
Jeff Gilbert 2011-10-19 15:09:57 -04:00
Родитель 9139d5704e
Коммит b9460bc0eb
2 изменённых файлов: 20 добавлений и 9 удалений

Просмотреть файл

@ -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<GLContextCGL> 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);

Просмотреть файл

@ -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);