зеркало из https://github.com/mozilla/pjs.git
Fix for 686083: Adds method to disable GL implementations
This commit is contained in:
Родитель
5f7f3220a2
Коммит
761c351fe0
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче