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
3 // found in the LICENSE file.
5 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZONE)
9 #include "ui/gl/gl_bindings.h"
12 #include "ui/gfx/x/x11_types.h"
16 #include "ui/gl/gl_surface_wgl.h"
19 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZONE)
20 #include "ui/gl/gl_surface_egl.h"
25 std::string
DriverOSMESA::GetPlatformExtensions() {
30 std::string
DriverWGL::GetPlatformExtensions() {
31 const char* str
= nullptr;
32 if (g_driver_wgl
.fn
.wglGetExtensionsStringARBFn
) {
33 str
= g_driver_wgl
.fn
.wglGetExtensionsStringARBFn(
34 GLSurfaceWGL::GetDisplayDC());
35 } else if (g_driver_wgl
.fn
.wglGetExtensionsStringEXTFn
) {
36 str
= g_driver_wgl
.fn
.wglGetExtensionsStringEXTFn();
38 return str
? std::string(str
) : "";
42 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZONE)
43 std::string
DriverEGL::GetPlatformExtensions() {
44 EGLDisplay display
= GLSurfaceEGL::InitializeDisplay();
45 if (display
== EGL_NO_DISPLAY
)
48 DCHECK(g_driver_egl
.fn
.eglQueryStringFn
);
49 const char* str
= g_driver_egl
.fn
.eglQueryStringFn(display
, EGL_EXTENSIONS
);
50 return str
? std::string(str
) : "";
54 std::string
DriverEGL::GetClientExtensions() {
55 DCHECK(g_driver_egl
.fn
.eglQueryStringFn
);
57 g_driver_egl
.fn
.eglQueryStringFn(EGL_NO_DISPLAY
, EGL_EXTENSIONS
);
58 return str
? std::string(str
) : "";
63 std::string
DriverGLX::GetPlatformExtensions() {
64 DCHECK(g_driver_glx
.fn
.glXQueryExtensionsStringFn
);
66 g_driver_glx
.fn
.glXQueryExtensionsStringFn(gfx::GetXDisplay(), 0);
67 return str
? std::string(str
) : "";