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
3 // found in the LICENSE file.
5 #include "ui/gl/gl_egl_api_implementation.h"
6 #include "ui/gl/gl_implementation.h"
10 RealEGLApi
* g_real_egl
;
12 void InitializeStaticGLBindingsEGL() {
13 g_driver_egl
.InitializeStaticBindings();
15 g_real_egl
= new RealEGLApi();
17 g_real_egl
->Initialize(&g_driver_egl
);
18 g_current_egl_context
= g_real_egl
;
21 void InitializeDynamicGLBindingsEGL(GLContext
* context
) {
22 g_driver_egl
.InitializeDynamicBindings(context
);
25 void InitializeDebugGLBindingsEGL() {
26 g_driver_egl
.InitializeDebugBindings();
29 void ClearGLBindingsEGL() {
34 g_current_egl_context
= NULL
;
35 g_driver_egl
.ClearBindings();
44 EGLApiBase::EGLApiBase()
48 EGLApiBase::~EGLApiBase() {
51 void EGLApiBase::InitializeBase(DriverEGL
* driver
) {
55 RealEGLApi::RealEGLApi() {
58 RealEGLApi::~RealEGLApi() {
61 void RealEGLApi::Initialize(DriverEGL
* driver
) {
62 InitializeBase(driver
);
65 TraceEGLApi::~TraceEGLApi() {
68 bool GetGLWindowSystemBindingInfoEGL(GLWindowSystemBindingInfo
* info
) {
69 EGLDisplay display
= eglGetCurrentDisplay();
70 const char* vendor
= eglQueryString(display
, EGL_VENDOR
);
71 const char* version
= eglQueryString(display
, EGL_VERSION
);
72 const char* extensions
= eglQueryString(display
, EGL_EXTENSIONS
);
73 *info
= GLWindowSystemBindingInfo();
75 info
->vendor
= vendor
;
77 info
->version
= version
;
79 info
->extensions
= extensions
;