[email protected] | b97c908 | 2012-10-25 17:21:38 | [diff] [blame] | 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. | ||||
4 | |||||
5 | #include "ui/gl/gl_glx_api_implementation.h" | ||||
6 | |||||
7 | namespace gfx { | ||||
8 | |||||
9 | RealGLXApi* g_real_glx; | ||||
10 | |||||
11 | void 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 | |||||
20 | void InitializeGLExtensionBindingsGLX(GLContext* context) { | ||||
21 | g_driver_glx.InitializeExtensionBindings(context); | ||||
22 | } | ||||
23 | |||||
24 | void InitializeDebugGLBindingsGLX() { | ||||
25 | g_driver_glx.InitializeDebugBindings(); | ||||
26 | } | ||||
27 | |||||
28 | void 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 | |||||
37 | GLXApi::GLXApi() { | ||||
38 | } | ||||
39 | |||||
40 | GLXApi::~GLXApi() { | ||||
41 | } | ||||
42 | |||||
[email protected] | 95c9d11 | 2012-12-16 04:52:36 | [diff] [blame^] | 43 | GLXApiBase::GLXApiBase() |
44 | : driver_(NULL) { | ||||
45 | } | ||||
46 | |||||
47 | GLXApiBase::~GLXApiBase() { | ||||
48 | } | ||||
49 | |||||
50 | void GLXApiBase::InitializeBase(DriverGLX* driver) { | ||||
51 | driver_ = driver; | ||||
52 | } | ||||
53 | |||||
[email protected] | b97c908 | 2012-10-25 17:21:38 | [diff] [blame] | 54 | RealGLXApi::RealGLXApi() { |
55 | } | ||||
56 | |||||
[email protected] | 1868a34 | 2012-11-07 15:56:02 | [diff] [blame] | 57 | RealGLXApi::~RealGLXApi() { |
58 | } | ||||
59 | |||||
[email protected] | b97c908 | 2012-10-25 17:21:38 | [diff] [blame] | 60 | void RealGLXApi::Initialize(DriverGLX* driver) { |
[email protected] | 95c9d11 | 2012-12-16 04:52:36 | [diff] [blame^] | 61 | InitializeBase(driver); |
[email protected] | b97c908 | 2012-10-25 17:21:38 | [diff] [blame] | 62 | } |
63 | |||||
64 | } // namespace gfx | ||||
65 | |||||
66 |