Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / gl / gl_wgl_api_implementation.cc
blob063916af04915cbdc3436c4d19f48826b4abed56
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_wgl_api_implementation.h"
7 namespace gfx {
9 RealWGLApi* g_real_wgl;
11 void InitializeGLBindingsWGL() {
12 g_driver_wgl.InitializeBindings();
13 if (!g_real_wgl) {
14 g_real_wgl = new RealWGLApi();
16 g_real_wgl->Initialize(&g_driver_wgl);
17 g_current_wgl_context = g_real_wgl;
20 void InitializeGLExtensionBindingsWGL(GLContext* context) {
21 g_driver_wgl.InitializeExtensionBindings(context);
24 void InitializeDebugGLBindingsWGL() {
25 g_driver_wgl.InitializeDebugBindings();
28 void ClearGLBindingsWGL() {
29 if (g_real_wgl) {
30 delete g_real_wgl;
31 g_real_wgl = NULL;
33 g_current_wgl_context = NULL;
34 g_driver_wgl.ClearBindings();
37 WGLApi::WGLApi() {
40 WGLApi::~WGLApi() {
43 WGLApiBase::WGLApiBase()
44 : driver_(NULL) {
47 WGLApiBase::~WGLApiBase() {
50 void WGLApiBase::InitializeBase(DriverWGL* driver) {
51 driver_ = driver;
54 RealWGLApi::RealWGLApi() {
57 RealWGLApi::~RealWGLApi() {
60 void RealWGLApi::Initialize(DriverWGL* driver) {
61 InitializeBase(driver);
64 TraceWGLApi::~TraceWGLApi() {
67 } // namespace gfx