diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-18 13:31:39 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-18 13:31:39 +0000 |
commit | 5b51f3395c92f301813d38b0439a6f061d98015d (patch) | |
tree | 2800230cc8e063444005f3ee728430b142a438e9 /app | |
parent | b160d7edd904e347eebbc34fd5169d3f17ef4e1c (diff) | |
download | chromium_src-5b51f3395c92f301813d38b0439a6f061d98015d.zip chromium_src-5b51f3395c92f301813d38b0439a6f061d98015d.tar.gz chromium_src-5b51f3395c92f301813d38b0439a6f061d98015d.tar.bz2 |
The GPU process cannot be placed on a UI thread in --single-process mode because glib is not thread safe. This patch moves it onto a IO thread instead.
Connections to the X server are not thread safe. I've made changes so that each thread gets it's own connection.
Finally, GpuHostMsg_GetViewXID needed to be needed to be sent from the thread added to GpuChannel instead of ChildThread::current().
BUG=69674
TEST=try --single-process with --enable-accelerated-layers on http://webkit.org/blog/386/3d-transforms/
Review URL: http://codereview.chromium.org/6340004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/gfx/gl/gl_context_egl.cc | 9 | ||||
-rw-r--r-- | app/gfx/gl/gl_context_linux.cc | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/app/gfx/gl/gl_context_egl.cc b/app/gfx/gl/gl_context_egl.cc index 3fddb30..8a5fb68 100644 --- a/app/gfx/gl/gl_context_egl.cc +++ b/app/gfx/gl/gl_context_egl.cc @@ -4,11 +4,14 @@ #include <EGL/egl.h> -#include "build/build_config.h" #if defined(OS_LINUX) -#include "app/x11_util.h" +extern "C" { +#include <X11/Xlib.h> +} #define EGL_HAS_PBUFFERS 1 #endif + +#include "build/build_config.h" #include "base/logging.h" #include "base/scoped_ptr.h" #include "app/gfx/gl/gl_bindings.h" @@ -80,7 +83,7 @@ bool BaseEGLContext::InitializeOneOff() { return true; #ifdef OS_LINUX - EGLNativeDisplayType native_display = x11_util::GetXDisplay(); + EGLNativeDisplayType native_display = XOpenDisplay(NULL); #else EGLNativeDisplayType native_display = EGL_DEFAULT_DISPLAY; #endif diff --git a/app/gfx/gl/gl_context_linux.cc b/app/gfx/gl/gl_context_linux.cc index 5fa77ce..9e4bfee 100644 --- a/app/gfx/gl/gl_context_linux.cc +++ b/app/gfx/gl/gl_context_linux.cc @@ -28,16 +28,14 @@ Display* GetXDisplayHelper() { static Display* display = NULL; if (!display) { - if (x11_util::XDisplayExists()) { - display = x11_util::GetXDisplay(); - } else { - display = XOpenDisplay(NULL); - } + display = XOpenDisplay(NULL); + CHECK(display); } + return display; } -} +} // namespace namespace gfx { |