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

Side by Side Diff: ui/gfx/gl/gl_surface_glx.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.cc ('k') | ui/gfx/gl/gl_surface_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "ui/gfx/gl/gl_surface_glx.h" 9 #include "ui/gfx/gl/gl_surface_glx.h"
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop.h"
14 #include "base/process_util.h" 15 #include "base/process_util.h"
15 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" 16 #include "third_party/mesa/MesaLib/include/GL/osmesa.h"
16 #include "ui/base/x/x11_util.h" 17 #include "ui/base/x/x11_util.h"
17 #include "ui/gfx/gl/gl_bindings.h" 18 #include "ui/gfx/gl/gl_bindings.h"
18 #include "ui/gfx/gl/gl_implementation.h" 19 #include "ui/gfx/gl/gl_implementation.h"
19 20
20 namespace gfx { 21 namespace gfx {
21 22
22 namespace { 23 namespace {
23 24
(...skipping 17 matching lines...) Expand all
41 } 42 }
42 43
43 GLSurfaceGLX::~GLSurfaceGLX() { 44 GLSurfaceGLX::~GLSurfaceGLX() {
44 } 45 }
45 46
46 bool GLSurfaceGLX::InitializeOneOff() { 47 bool GLSurfaceGLX::InitializeOneOff() {
47 static bool initialized = false; 48 static bool initialized = false;
48 if (initialized) 49 if (initialized)
49 return true; 50 return true;
50 51
51 g_display = XOpenDisplay(NULL); 52 g_display = base::MessagePumpForUI::GetDefaultXDisplay();
52 if (!g_display) { 53 if (!g_display) {
53 LOG(ERROR) << "XOpenDisplay failed."; 54 LOG(ERROR) << "XOpenDisplay failed.";
54 return false; 55 return false;
55 } 56 }
56 57
57 int major, minor; 58 int major, minor;
58 if (!glXQueryVersion(g_display, &major, &minor)) { 59 if (!glXQueryVersion(g_display, &major, &minor)) {
59 LOG(ERROR) << "glxQueryVersion failed"; 60 LOG(ERROR) << "glxQueryVersion failed";
60 return false; 61 return false;
61 } 62 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 306
306 void* PbufferGLSurfaceGLX::GetHandle() { 307 void* PbufferGLSurfaceGLX::GetHandle() {
307 return reinterpret_cast<void*>(pbuffer_); 308 return reinterpret_cast<void*>(pbuffer_);
308 } 309 }
309 310
310 void* PbufferGLSurfaceGLX::GetConfig() { 311 void* PbufferGLSurfaceGLX::GetConfig() {
311 return config_; 312 return config_;
312 } 313 }
313 314
314 } // namespace gfx 315 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.cc ('k') | ui/gfx/gl/gl_surface_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698