blob: dc145ad9bf72b641d2104e4eb014724cba412133 [file] [log] [blame]
[email protected]b97c9082012-10-25 17:21:381// 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.
4
5#include "ui/gl/gl_glx_api_implementation.h"
6
7namespace gfx {
8
9RealGLXApi* g_real_glx;
10
11void InitializeGLBindingsGLX() {
12 g_driver_glx.InitializeBindings();
13 if (!g_real_glx) {
14 g_real_glx = new RealGLXApi();
15 }
16 g_real_glx->Initialize(&g_driver_glx);
17 g_current_glx_context = g_real_glx;
18}
19
20void InitializeGLExtensionBindingsGLX(GLContext* context) {
21 g_driver_glx.InitializeExtensionBindings(context);
22}
23
24void InitializeDebugGLBindingsGLX() {
25 g_driver_glx.InitializeDebugBindings();
26}
27
28void ClearGLBindingsGLX() {
29 if (g_real_glx) {
30 delete g_real_glx;
31 g_real_glx = NULL;
32 }
33 g_current_glx_context = NULL;
34 g_driver_glx.ClearBindings();
35}
36
37GLXApi::GLXApi() {
38}
39
40GLXApi::~GLXApi() {
41}
42
[email protected]95c9d112012-12-16 04:52:3643GLXApiBase::GLXApiBase()
44 : driver_(NULL) {
45}
46
47GLXApiBase::~GLXApiBase() {
48}
49
50void GLXApiBase::InitializeBase(DriverGLX* driver) {
51 driver_ = driver;
52}
53
[email protected]b97c9082012-10-25 17:21:3854RealGLXApi::RealGLXApi() {
55}
56
[email protected]1868a342012-11-07 15:56:0257RealGLXApi::~RealGLXApi() {
58}
59
[email protected]b97c9082012-10-25 17:21:3860void RealGLXApi::Initialize(DriverGLX* driver) {
[email protected]95c9d112012-12-16 04:52:3661 InitializeBase(driver);
[email protected]b97c9082012-10-25 17:21:3862}
63
64} // namespace gfx
65
66