Bug 1245550 - add gfx.use-glx-texture-from-pixmap pref to control whether texture_from_pixmap is used. r=nical

This commit is contained in:
Lee Salzman 2016-02-03 13:05:24 -05:00
parent 7bbb6996af
commit 6df289e33c
4 changed files with 8 additions and 13 deletions

View File

@ -32,6 +32,7 @@
#include "gfxUtils.h"
#include "gfx2DGlue.h"
#include "GLScreenBuffer.h"
#include "gfxPrefs.h"
#include "gfxCrashReporterUtils.h"
@ -227,11 +228,7 @@ GLXLibrary::EnsureInitialized()
GLLibraryLoader::LoadSymbols(mOGLLibrary, symbols_texturefrompixmap,
(GLLibraryLoader::PlatformLookupFunction)&xGetProcAddress))
{
#ifdef MOZ_WIDGET_GTK
mUseTextureFromPixmap = gfxPlatformGtk::GetPlatform()->UseXRender();
#else
mUseTextureFromPixmap = true;
#endif
mUseTextureFromPixmap = gfxPrefs::UseGLXTextureFromPixmap();
} else {
mUseTextureFromPixmap = false;
NS_WARNING("Texture from pixmap disabled");

View File

@ -81,7 +81,7 @@ GLScreenBuffer::CreateFactory(GLContext* gl,
#elif defined(MOZ_WIDGET_GONK)
factory = MakeUnique<SurfaceFactory_Gralloc>(gl, caps, forwarder, flags);
#elif defined(GL_PROVIDER_GLX)
if (sGLXLibrary.UseSurfaceSharing())
if (sGLXLibrary.UseTextureFromPixmap())
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, forwarder, flags);
#elif defined(MOZ_WIDGET_UIKIT)
factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, forwarder, mFlags);
@ -116,7 +116,7 @@ GLScreenBuffer::CreateFactory(GLContext* gl,
}
#ifdef GL_PROVIDER_GLX
if (!factory && sGLXLibrary.UseSurfaceSharing()) {
if (!factory && sGLXLibrary.UseTextureFromPixmap()) {
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, forwarder, flags);
}
#endif

View File

@ -134,12 +134,6 @@ public:
bool SupportsTextureFromPixmap(gfxASurface* aSurface);
bool IsATI() { return mIsATI; }
bool GLXVersionCheck(int aMajor, int aMinor);
bool UseSurfaceSharing() {
// Disable surface sharing due to issues with compatible FBConfigs on
// NVIDIA drivers as described in bug 1193015.
static bool useSharing = PR_GetEnv("MOZ_GLX_USE_SURFACE_SHARING");
return mUseTextureFromPixmap && useSharing;
}
private:

View File

@ -263,6 +263,10 @@ private:
DECL_GFX_PREF(Live, "gfx.content.use-native-pushlayer", UseNativePushLayer, bool, false);
// Disable surface sharing due to issues with compatible FBConfigs on
// NVIDIA drivers as described in bug 1193015.
DECL_GFX_PREF(Live, "gfx.use-glx-texture-from-pixmap", UseGLXTextureFromPixmap, bool, false);
// These times should be in milliseconds
DECL_GFX_PREF(Once, "gfx.touch.resample.delay-threshold", TouchResampleVsyncDelayThreshold, int32_t, 20);
DECL_GFX_PREF(Once, "gfx.touch.resample.max-predict", TouchResampleMaxPredict, int32_t, 8);