summaryrefslogtreecommitdiffstats
path: root/ui/gl
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-14 21:13:20 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-14 21:13:20 +0000
commitc8ef1d0bc63aa014ba0fb94049671b371c0d5d18 (patch)
treef3f7a66331dde62271d9f9aeac0618cb9a07946b /ui/gl
parent4b05a7bb244c80ffd75fd67cbb8d55f6735a5e04 (diff)
downloadchromium_src-c8ef1d0bc63aa014ba0fb94049671b371c0d5d18.zip
chromium_src-c8ef1d0bc63aa014ba0fb94049671b371c0d5d18.tar.gz
chromium_src-c8ef1d0bc63aa014ba0fb94049671b371c0d5d18.tar.bz2
x11: Remove X11 message-pump.
The remaining use of the X11 mesage-pump was opening the connection to the X11 server. This patch moves that out of the message-pump, into gfx. This allows us to remove the X11 message-pump, and just use the base Glib-based message-pump on Linux and ChromeOS. BUG=354062 R=darin@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/235043005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r--ui/gl/gl_image_glx.cc3
-rw-r--r--ui/gl/gl_surface_glx.cc19
-rw-r--r--ui/gl/gl_surface_x11.cc7
3 files changed, 9 insertions, 20 deletions
diff --git a/ui/gl/gl_image_glx.cc b/ui/gl/gl_image_glx.cc
index b68a5fe..4b7e883 100644
--- a/ui/gl/gl_image_glx.cc
+++ b/ui/gl/gl_image_glx.cc
@@ -12,6 +12,7 @@ extern "C" {
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_surface_glx.h"
@@ -43,7 +44,7 @@ int TextureFormat(int depth) {
} // namespace anonymous
GLImageGLX::GLImageGLX(gfx::PluginWindowHandle window)
- : display_(base::MessagePumpForUI::GetDefaultXDisplay()),
+ : display_(gfx::GetXDisplay()),
window_(window),
pixmap_(0),
glx_pixmap_(0) {}
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index 7647694..b97606a3 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -21,6 +21,7 @@ extern "C" {
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "third_party/mesa/src/include/GL/osmesa.h"
+#include "ui/gfx/x/x11_connection.h"
#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
@@ -378,22 +379,8 @@ bool GLSurfaceGLX::InitializeOneOff() {
// SGIVideoSyncProviderShim (if instantiated) will issue X commands on
// it's own thread.
- XInitThreads();
-
-#if defined(TOOLKIT_GTK)
- // Be sure to use the X display handle and not the GTK display handle if this
- // is the GPU process.
- g_create_child_windows =
- base::MessageLoop::current() &&
- base::MessageLoop::current()->type() == base::MessageLoop::TYPE_GPU;
-
- if (g_create_child_windows)
- g_display = base::MessagePumpX11::GetDefaultXDisplay();
- else
- g_display = base::MessagePumpForUI::GetDefaultXDisplay();
-#else
- g_display = base::MessagePumpForUI::GetDefaultXDisplay();
-#endif
+ gfx::InitializeThreadedX11();
+ g_display = gfx::GetXDisplay();
if (!g_display) {
LOG(ERROR) << "XOpenDisplay failed.";
diff --git a/ui/gl/gl_surface_x11.cc b/ui/gl/gl_surface_x11.cc
index 066f915..a5d5aab 100644
--- a/ui/gl/gl_surface_x11.cc
+++ b/ui/gl/gl_surface_x11.cc
@@ -10,6 +10,7 @@
#include "base/message_loop/message_loop.h"
#include "third_party/mesa/src/include/GL/osmesa.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface_egl.h"
@@ -79,7 +80,7 @@ bool GLSurface::InitializeOneOffInternal() {
NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
gfx::AcceleratedWidget window)
: GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)),
- xdisplay_(base::MessagePumpForUI::GetDefaultXDisplay()),
+ xdisplay_(gfx::GetXDisplay()),
window_graphics_context_(0),
window_(window),
pixmap_graphics_context_(0),
@@ -94,7 +95,7 @@ bool NativeViewGLSurfaceOSMesa::InitializeOneOff() {
if (initialized)
return true;
- if (!base::MessagePumpForUI::GetDefaultXDisplay()) {
+ if (!gfx::GetXDisplay()) {
LOG(ERROR) << "XOpenDisplay failed.";
return false;
}
@@ -341,7 +342,7 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
}
EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
- return base::MessagePumpForUI::GetDefaultXDisplay();
+ return gfx::GetXDisplay();
}
} // namespace gfx