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 extern "C" { | 5 extern "C" { |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 } | 7 } |
8 | 8 |
9 #include "ui/gl/gl_surface_glx.h" | 9 #include "ui/gl/gl_surface_glx.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return true; | 71 return true; |
72 } | 72 } |
73 | 73 |
74 // static | 74 // static |
75 const char* GLSurfaceGLX::GetGLXExtensions() { | 75 const char* GLSurfaceGLX::GetGLXExtensions() { |
76 return g_glx_extensions; | 76 return g_glx_extensions; |
77 } | 77 } |
78 | 78 |
79 // static | 79 // static |
80 bool GLSurfaceGLX::HasGLXExtension(const char* name) { | 80 bool GLSurfaceGLX::HasGLXExtension(const char* name) { |
81 DCHECK(name); | 81 return ExtensionsContain(GetGLXExtensions(), name); |
82 const char* c_extensions = GetGLXExtensions(); | |
83 if (!c_extensions) | |
84 return false; | |
85 std::string extensions(c_extensions); | |
86 extensions += " "; | |
87 | |
88 std::string delimited_name(name); | |
89 delimited_name += " "; | |
90 | |
91 return extensions.find(delimited_name) != std::string::npos; | |
92 } | 82 } |
93 | 83 |
94 // static | 84 // static |
95 bool GLSurfaceGLX::IsCreateContextRobustnessSupported() { | 85 bool GLSurfaceGLX::IsCreateContextRobustnessSupported() { |
96 return g_glx_create_context_robustness_supported; | 86 return g_glx_create_context_robustness_supported; |
97 } | 87 } |
98 | 88 |
99 void* GLSurfaceGLX::GetDisplay() { | 89 void* GLSurfaceGLX::GetDisplay() { |
100 return g_display; | 90 return g_display; |
101 } | 91 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 308 |
319 void* PbufferGLSurfaceGLX::GetConfig() { | 309 void* PbufferGLSurfaceGLX::GetConfig() { |
320 return config_; | 310 return config_; |
321 } | 311 } |
322 | 312 |
323 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 313 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
324 Destroy(); | 314 Destroy(); |
325 } | 315 } |
326 | 316 |
327 } // namespace gfx | 317 } // namespace gfx |
OLD | NEW |