summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 19:07:05 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 19:07:05 +0000
commit74c66a6f8e7ee4730885cc79c88d64ba2fc3cb3d (patch)
tree6dee338407fde5008a41981c37554bd07a6af51b /gpu/command_buffer
parentc5874d55686f444954222f604bd79ff15d7a4325 (diff)
downloadchromium_src-74c66a6f8e7ee4730885cc79c88d64ba2fc3cb3d.zip
chromium_src-74c66a6f8e7ee4730885cc79c88d64ba2fc3cb3d.tar.gz
chromium_src-74c66a6f8e7ee4730885cc79c88d64ba2fc3cb3d.tar.bz2
Fixed GPU process startup crash on Linux. Because there was no current
OpenGL context, glXGetCurrentDisplay() was returning NULL, leading to crashes in glXQueryVersion. Exposed a new glxewContextInitWithDisplay from GLEW allowing the caller to supply the display connection. Built both with and without GLEW_MX to ensure GLEW changes compile in both scenarios. BUG=40148 TEST=ran WebGL demos in debugger, verified Display* passed to glXQueryVersion Review URL: http://codereview.chromium.org/1556015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/x_utils.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/gpu/command_buffer/service/x_utils.cc b/gpu/command_buffer/service/x_utils.cc
index 9c10377..30a9167 100644
--- a/gpu/command_buffer/service/x_utils.cc
+++ b/gpu/command_buffer/service/x_utils.cc
@@ -31,7 +31,7 @@ class ScopedPtrXFree {
static bool g_glxew_initialized = false;
static bool g_glew_initialized = false;
-static bool InitializeGLXEW() {
+static bool InitializeGLXEW(Display* display) {
if (!g_glxew_initialized) {
void* handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
if (!handle) {
@@ -44,13 +44,11 @@ static bool InitializeGLXEW() {
LOG(ERROR) << "glxewInit failed";
return false;
}
- // Hack to work around apparently incorrect assumption in
- // glxewContextInit. Documentation indicates that all of the work
- // it does is actually context-independent. We require GLX 1.3
- // entry points to be present for successful initialization of the
- // off-screen code path in the GLES2Decoder. TODO(kbr): clean this
- // up.
- if (glxewContextInit() != GLEW_OK) {
+ // glxewContextInit really only needs a display connection to
+ // complete, and we don't want to have to create an OpenGL context
+ // just to get access to GLX 1.3 entry points to create pbuffers.
+ // We therefore added a glxewContextInitWithDisplay entry point.
+ if (glxewContextInitWithDisplay(display) != GLEW_OK) {
LOG(ERROR) << "glxewContextInit failed";
return false;
}
@@ -111,7 +109,7 @@ void GLXContextWrapper::Destroy() {
}
bool XWindowWrapper::Initialize() {
- if (!InitializeGLXEW())
+ if (!InitializeGLXEW(GetDisplay()))
return false;
XWindowAttributes attributes;
@@ -162,7 +160,7 @@ void XWindowWrapper::SwapBuffers() {
}
bool GLXPbufferWrapper::Initialize() {
- if (!InitializeGLXEW())
+ if (!InitializeGLXEW(GetDisplay()))
return false;
if (!glXChooseFBConfig ||