Back out changeset 5b1a9f0706de (bug 1213431) on suspicion of causing Mulet bustage in webgl-capturestream-test.html?preserve

This commit is contained in:
Phil Ringnalda 2015-10-31 13:33:41 -07:00
parent d8a1629175
commit a11db4c721
3 changed files with 21 additions and 55 deletions

View File

@ -25,8 +25,7 @@ public:
GLXDrawable drawable,
GLXFBConfig cfg,
bool deleteDrawable,
gfxXlibSurface* pixmap = nullptr,
ContextProfile profile = ContextProfile::OpenGLCompatibility);
gfxXlibSurface* pixmap = nullptr);
~GLContextGLX();
@ -71,8 +70,7 @@ private:
GLXContext aContext,
bool aDeleteDrawable,
bool aDoubleBuffered,
gfxXlibSurface *aPixmap,
ContextProfile profile);
gfxXlibSurface *aPixmap);
GLXContext mContext;
Display *mDisplay;

View File

@ -164,7 +164,7 @@ GLXLibrary::EnsureInitialized()
{ nullptr, { nullptr } }
};
GLLibraryLoader::SymLoadStruct symbols_createcontext[] = {
GLLibraryLoader::SymLoadStruct symbols_robustness[] = {
{ (PRFuncPtr*) &xCreateContextAttribsInternal, { "glXCreateContextAttribsARB", nullptr } },
{ nullptr, { nullptr } }
};
@ -237,15 +237,9 @@ GLXLibrary::EnsureInitialized()
NS_WARNING("Texture from pixmap disabled");
}
if (HasExtension(extensionsStr, "GLX_ARB_create_context") &&
HasExtension(extensionsStr, "GLX_ARB_create_context_profile") &&
GLLibraryLoader::LoadSymbols(mOGLLibrary, symbols_createcontext,
if (HasExtension(extensionsStr, "GLX_ARB_create_context_robustness") &&
GLLibraryLoader::LoadSymbols(mOGLLibrary, symbols_robustness,
(GLLibraryLoader::PlatformLookupFunction)&xGetProcAddress))
{
mHasCreateContextAttribs = true;
}
if (HasExtension(extensionsStr, "GLX_ARB_create_context_robustness"))
{
mHasRobustness = true;
}
@ -750,8 +744,7 @@ GLContextGLX::CreateGLContext(
GLXDrawable drawable,
GLXFBConfig cfg,
bool deleteDrawable,
gfxXlibSurface* pixmap,
ContextProfile profile)
gfxXlibSurface* pixmap)
{
GLXLibrary& glx = sGLXLibrary;
@ -777,31 +770,19 @@ TRY_AGAIN_NO_SHARING:
error = false;
GLXContext glxContext = shareContext ? shareContext->mContext : nullptr;
if (glx.HasCreateContextAttribs()) {
nsAutoTArray<int, 11> attrib_list;
if (glx.HasRobustness()) {
int robust_attribs[] = {
LOCAL_GL_CONTEXT_FLAGS_ARB, LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB,
LOCAL_GL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, LOCAL_GL_LOSE_CONTEXT_ON_RESET_ARB,
};
attrib_list.AppendElements(robust_attribs, MOZ_ARRAY_LENGTH(robust_attribs));
}
if (profile == ContextProfile::OpenGLCore) {
int core_attribs[] = {
LOCAL_GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
LOCAL_GLX_CONTEXT_MINOR_VERSION_ARB, 2,
LOCAL_GLX_CONTEXT_FLAGS_ARB, LOCAL_GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
};
attrib_list.AppendElements(core_attribs, MOZ_ARRAY_LENGTH(core_attribs));
if (glx.HasRobustness()) {
int attrib_list[] = {
LOCAL_GL_CONTEXT_FLAGS_ARB, LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB,
LOCAL_GL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB, LOCAL_GL_LOSE_CONTEXT_ON_RESET_ARB,
0,
};
attrib_list.AppendElement(0);
context = glx.xCreateContextAttribs(
display,
cfg,
glxContext,
True,
attrib_list.Elements());
attrib_list);
} else {
context = glx.xCreateNewContext(
display,
@ -820,8 +801,7 @@ TRY_AGAIN_NO_SHARING:
context,
deleteDrawable,
db,
pixmap,
profile);
pixmap);
if (!glContext->Init())
error = true;
} else {
@ -877,9 +857,7 @@ GLContextGLX::Init()
return false;
}
// EXT_framebuffer_object is not supported on Core contexts
// so we'll also check for ARB_framebuffer_object
if (!IsExtensionSupported(EXT_framebuffer_object) && !IsSupported(GLFeature::framebuffer_object))
if (!IsExtensionSupported(EXT_framebuffer_object))
return false;
return true;
@ -976,8 +954,7 @@ GLContextGLX::GLContextGLX(
GLXContext aContext,
bool aDeleteDrawable,
bool aDoubleBuffered,
gfxXlibSurface *aPixmap,
ContextProfile profile)
gfxXlibSurface *aPixmap)
: GLContext(caps, shareContext, isOffscreen),//aDeleteDrawable ? true : false, aShareContext, ),
mContext(aContext),
mDisplay(aDisplay),
@ -990,7 +967,7 @@ GLContextGLX::GLContextGLX(
{
MOZ_ASSERT(mGLX);
// See 899855
SetProfileVersion(profile, 200);
SetProfileVersion(ContextProfile::OpenGLCompatibility, 200);
}
@ -1039,8 +1016,7 @@ GLContextProviderGLX::CreateWrappingExisting(void* aContext, void* aSurface)
(GLXDrawable)aSurface, (GLXContext)aContext,
false, // aDeleteDrawable,
true,
(gfxXlibSurface*)nullptr,
ContextProfile::OpenGLCompatibility);
(gfxXlibSurface*)nullptr);
glContext->mOwnsContext = false;
gGlobalContext = glContext;
@ -1213,7 +1189,7 @@ ChooseConfig(GLXLibrary* glx, Display* display, int screen, const SurfaceCaps& m
}
static already_AddRefed<GLContextGLX>
CreateOffscreenPixmapContext(const IntSize& size, const SurfaceCaps& minCaps, ContextProfile profile = ContextProfile::OpenGLCompatibility)
CreateOffscreenPixmapContext(const IntSize& size, const SurfaceCaps& minCaps)
{
GLXLibrary* glx = &sGLXLibrary;
if (!glx->EnsureInitialized())
@ -1271,7 +1247,7 @@ DONE_CREATING_PIXMAP:
GLContextGLX* shareContext = GetGlobalContextGLX();
return GLContextGLX::CreateGLContext(minCaps, shareContext, true, display, pixmap,
config, true, surface, profile);
config, true, surface);
}
/*static*/ already_AddRefed<GLContext>
@ -1294,13 +1270,8 @@ GLContextProviderGLX::CreateOffscreen(const IntSize& size,
minBackbufferCaps.stencil = false;
}
ContextProfile profile = ContextProfile::OpenGLCore;
if (flags & CreateContextFlags::REQUIRE_COMPAT_PROFILE) {
profile = ContextProfile::OpenGLCompatibility;
}
RefPtr<GLContext> gl;
gl = CreateOffscreenPixmapContext(size, minBackbufferCaps, profile);
gl = CreateOffscreenPixmapContext(size, minBackbufferCaps);
if (!gl)
return nullptr;

View File

@ -34,8 +34,7 @@ class GLXLibrary
public:
GLXLibrary() : mInitialized(false), mTriedInitializing(false),
mUseTextureFromPixmap(false), mDebug(false),
mHasRobustness(false), mHasCreateContextAttribs(false),
mIsATI(false), mIsNVIDIA(false),
mHasRobustness(false), mIsATI(false), mIsNVIDIA(false),
mClientIsMesa(false), mGLXMajorVersion(0),
mGLXMinorVersion(0),
mOGLLibrary(nullptr) {}
@ -107,7 +106,6 @@ public:
bool UseTextureFromPixmap() { return mUseTextureFromPixmap; }
bool HasRobustness() { return mHasRobustness; }
bool HasCreateContextAttribs() { return mHasCreateContextAttribs; }
bool SupportsTextureFromPixmap(gfxASurface* aSurface);
bool IsATI() { return mIsATI; }
bool GLXVersionCheck(int aMajor, int aMinor);
@ -218,7 +216,6 @@ private:
bool mUseTextureFromPixmap;
bool mDebug;
bool mHasRobustness;
bool mHasCreateContextAttribs;
bool mIsATI;
bool mIsNVIDIA;
bool mClientIsMesa;