| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(USE_EGL) | 7 #if defined(USE_EGL) |
| 8 #include <EGL/egl.h> | 8 #include <EGL/egl.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const char* str = nullptr; | 33 const char* str = nullptr; |
| 34 str = wglGetExtensionsStringARB(GLSurfaceWGL::GetDisplayDC()); | 34 str = wglGetExtensionsStringARB(GLSurfaceWGL::GetDisplayDC()); |
| 35 if (str) | 35 if (str) |
| 36 return str; | 36 return str; |
| 37 return wglGetExtensionsStringEXT(); | 37 return wglGetExtensionsStringEXT(); |
| 38 } | 38 } |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 #if defined(USE_EGL) | 41 #if defined(USE_EGL) |
| 42 std::string DriverEGL::GetPlatformExtensions() { | 42 std::string DriverEGL::GetPlatformExtensions() { |
| 43 EGLDisplay display = GLSurfaceEGL::InitializeDisplay(); | 43 EGLDisplay display = GLSurfaceEGL::GetHardwareDisplay(); |
| 44 if (display == EGL_NO_DISPLAY) | 44 if (display == EGL_NO_DISPLAY) |
| 45 return ""; | 45 return ""; |
| 46 const char* str = eglQueryString(display, EGL_EXTENSIONS); | 46 const char* str = eglQueryString(display, EGL_EXTENSIONS); |
| 47 return str ? std::string(str) : ""; | 47 return str ? std::string(str) : ""; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // static | 50 // static |
| 51 std::string DriverEGL::GetClientExtensions() { | 51 std::string DriverEGL::GetClientExtensions() { |
| 52 const char* str = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); | 52 const char* str = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); |
| 53 return str ? std::string(str) : ""; | 53 return str ? std::string(str) : ""; |
| 54 } | 54 } |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 #if defined(USE_GLX) | 57 #if defined(USE_GLX) |
| 58 std::string DriverGLX::GetPlatformExtensions() { | 58 std::string DriverGLX::GetPlatformExtensions() { |
| 59 const char* str = glXQueryExtensionsString(gfx::GetXDisplay(), 0); | 59 const char* str = glXQueryExtensionsString(gfx::GetXDisplay(), 0); |
| 60 return str ? std::string(str) : ""; | 60 return str ? std::string(str) : ""; |
| 61 } | 61 } |
| 62 #endif | 62 #endif |
| 63 | 63 |
| 64 } // namespace gl | 64 } // namespace gl |
| OLD | NEW |