Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / gl / gl_glx_api_implementation.cc
blobf8e75a2cb08b1838bfcea8df0e7ca1c4b4ea134d
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_glx_api_implementation.h"
7 namespace gfx {
9 RealGLXApi* g_real_glx;
11 void InitializeGLBindingsGLX() {
12 g_driver_glx.InitializeBindings();
13 if (!g_real_glx) {
14 g_real_glx = new RealGLXApi();
16 g_real_glx->Initialize(&g_driver_glx);
17 g_current_glx_context = g_real_glx;
20 void InitializeGLExtensionBindingsGLX(GLContext* context) {
21 g_driver_glx.InitializeExtensionBindings(context);
24 void InitializeDebugGLBindingsGLX() {
25 g_driver_glx.InitializeDebugBindings();
28 void ClearGLBindingsGLX() {
29 if (g_real_glx) {
30 delete g_real_glx;
31 g_real_glx = NULL;
33 g_current_glx_context = NULL;
34 g_driver_glx.ClearBindings();
37 GLXApi::GLXApi() {
40 GLXApi::~GLXApi() {
43 GLXApiBase::GLXApiBase()
44 : driver_(NULL) {
47 GLXApiBase::~GLXApiBase() {
50 void GLXApiBase::InitializeBase(DriverGLX* driver) {
51 driver_ = driver;
54 RealGLXApi::RealGLXApi() {
57 RealGLXApi::~RealGLXApi() {
60 void RealGLXApi::Initialize(DriverGLX* driver) {
61 InitializeBase(driver);
64 TraceGLXApi::~TraceGLXApi() {
67 } // namespace gfx