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

Side by Side Diff: ui/gfx/gl/gl_surface_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_surface_glx.cc ('k') | no next file » | 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 #include "ui/gfx/gl/gl_surface.h" 5 #include "ui/gfx/gl/gl_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h"
9 #if !defined(USE_WAYLAND) 10 #if !defined(USE_WAYLAND)
10 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" 11 #include "third_party/mesa/MesaLib/include/GL/osmesa.h"
11 #endif 12 #endif
12 #include "ui/gfx/gl/gl_bindings.h" 13 #include "ui/gfx/gl/gl_bindings.h"
13 #include "ui/gfx/gl/gl_implementation.h" 14 #include "ui/gfx/gl/gl_implementation.h"
14 #include "ui/gfx/gl/gl_surface_egl.h" 15 #include "ui/gfx/gl/gl_surface_egl.h"
15 #if !defined(USE_WAYLAND) 16 #if !defined(USE_WAYLAND)
16 #include "ui/gfx/gl/gl_surface_glx.h" 17 #include "ui/gfx/gl/gl_surface_glx.h"
17 #include "ui/gfx/gl/gl_surface_osmesa.h" 18 #include "ui/gfx/gl/gl_surface_osmesa.h"
18 #endif 19 #endif
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 102
102 NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() { 103 NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
103 Destroy(); 104 Destroy();
104 } 105 }
105 106
106 bool NativeViewGLSurfaceOSMesa::InitializeOneOff() { 107 bool NativeViewGLSurfaceOSMesa::InitializeOneOff() {
107 static bool initialized = false; 108 static bool initialized = false;
108 if (initialized) 109 if (initialized)
109 return true; 110 return true;
110 111
111 g_osmesa_display = XOpenDisplay(NULL); 112 g_osmesa_display = base::MessagePumpForUI::GetDefaultXDisplay();
112 if (!g_osmesa_display) { 113 if (!g_osmesa_display) {
113 LOG(ERROR) << "XOpenDisplay failed."; 114 LOG(ERROR) << "XOpenDisplay failed.";
114 return false; 115 return false;
115 } 116 }
116 117
117 initialized = true; 118 initialized = true;
118 return true; 119 return true;
119 } 120 }
120 121
121 bool NativeViewGLSurfaceOSMesa::Initialize() { 122 bool NativeViewGLSurfaceOSMesa::Initialize() {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 375 }
375 case kGLImplementationMockGL: 376 case kGLImplementationMockGL:
376 return new GLSurfaceStub; 377 return new GLSurfaceStub;
377 default: 378 default:
378 NOTREACHED(); 379 NOTREACHED();
379 return NULL; 380 return NULL;
380 } 381 }
381 } 382 }
382 383
383 } // namespace gfx 384 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_surface_glx.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698