OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gl/gl_glx_api_implementation.h" | 5 #include "ui/gl/gl_glx_api_implementation.h" |
| 6 #include "ui/gl/gl_implementation.h" |
6 | 7 |
7 namespace gfx { | 8 namespace gfx { |
8 | 9 |
9 RealGLXApi* g_real_glx; | 10 RealGLXApi* g_real_glx; |
10 | 11 |
11 void InitializeGLBindingsGLX() { | 12 void InitializeGLBindingsGLX() { |
12 g_driver_glx.InitializeBindings(); | 13 g_driver_glx.InitializeBindings(); |
13 if (!g_real_glx) { | 14 if (!g_real_glx) { |
14 g_real_glx = new RealGLXApi(); | 15 g_real_glx = new RealGLXApi(); |
15 } | 16 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 RealGLXApi::~RealGLXApi() { | 58 RealGLXApi::~RealGLXApi() { |
58 } | 59 } |
59 | 60 |
60 void RealGLXApi::Initialize(DriverGLX* driver) { | 61 void RealGLXApi::Initialize(DriverGLX* driver) { |
61 InitializeBase(driver); | 62 InitializeBase(driver); |
62 } | 63 } |
63 | 64 |
64 TraceGLXApi::~TraceGLXApi() { | 65 TraceGLXApi::~TraceGLXApi() { |
65 } | 66 } |
66 | 67 |
| 68 bool GetGLWindowSystemBindingInfoGLX(GLWindowSystemBindingInfo* info) { |
| 69 Display* display = glXGetCurrentDisplay(); |
| 70 const int kDefaultScreen = 0; |
| 71 const char* vendor = |
| 72 glXQueryServerString(display, kDefaultScreen, GLX_VENDOR); |
| 73 const char* version = |
| 74 glXQueryServerString(display, kDefaultScreen, GLX_VERSION); |
| 75 const char* extensions = |
| 76 glXQueryServerString(display, kDefaultScreen, GLX_EXTENSIONS); |
| 77 *info = GLWindowSystemBindingInfo(); |
| 78 if (vendor) |
| 79 info->vendor = vendor; |
| 80 if (version) |
| 81 info->version = version; |
| 82 if (extensions) |
| 83 info->extensions = extensions; |
| 84 return true; |
| 85 } |
| 86 |
67 } // namespace gfx | 87 } // namespace gfx |
68 | 88 |
69 | 89 |
OLD | NEW |