Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: ui/gfx/compositor/test/test_compositor_host_linux.cc

Issue 8890042: Share X connection between GLSurfaceGLX/EGL and MessagePumpX/GTK (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix hang in unittests Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | ui/gfx/gl/gl_surface_egl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/test/test_compositor_host_linux.cc
diff --git a/ui/gfx/compositor/test/test_compositor_host_linux.cc b/ui/gfx/compositor/test/test_compositor_host_linux.cc
index c3136d1aec1d9ca4aaca2f3dfc7bb8524af41df8..a13fa3a9247a4693c3dca5e5119d4832e11548a3 100644
--- a/ui/gfx/compositor/test/test_compositor_host_linux.cc
+++ b/ui/gfx/compositor/test/test_compositor_host_linux.cc
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/message_loop.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/rect.h"
@@ -45,8 +46,6 @@ class TestCompositorHostLinux : public TestCompositorHost,
scoped_refptr<ui::Compositor> compositor_;
- Display* display_;
-
XID window_;
DISALLOW_COPY_AND_ASSIGN(TestCompositorHostLinux);
@@ -57,28 +56,27 @@ TestCompositorHostLinux::TestCompositorHostLinux(const gfx::Rect& bounds)
}
TestCompositorHostLinux::~TestCompositorHostLinux() {
- XDestroyWindow(display_, window_);
}
void TestCompositorHostLinux::Show() {
- display_ = XOpenDisplay(NULL);
+ Display* display = base::MessagePumpForUI::GetDefaultXDisplay();
XSetWindowAttributes swa;
swa.event_mask = StructureNotifyMask | ExposureMask;
swa.override_redirect = True;
window_ = XCreateWindow(
- display_,
- RootWindow(display_, DefaultScreen(display_)), // parent
+ display,
+ RootWindow(display, DefaultScreen(display)), // parent
bounds_.x(), bounds_.y(), bounds_.width(), bounds_.height(),
0, // border width
CopyFromParent, // depth
InputOutput,
CopyFromParent, // visual
CWEventMask | CWOverrideRedirect, &swa);
- XMapWindow(display_, window_);
+ XMapWindow(display, window_);
while (1) {
XEvent event;
- XNextEvent(display_, &event);
+ XNextEvent(display, &event);
if (event.type == MapNotify && event.xmap.window == window_)
break;
}
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | ui/gfx/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698