OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gl/gl_egl_api_implementation.h" | 5 #include "ui/gl/gl_egl_api_implementation.h" |
6 #include "ui/gl/gl_implementation.h" | 6 #include "ui/gl/gl_implementation.h" |
7 | 7 |
8 namespace gfx { | 8 namespace gfx { |
9 | 9 |
10 RealEGLApi* g_real_egl; | 10 RealEGLApi* g_real_egl; |
11 | 11 |
12 void InitializeGLBindingsEGL() { | 12 void InitializeGLBindingsEGL() { |
13 g_driver_egl.InitializeBindings(); | 13 g_driver_egl.InitializeBindings(); |
14 if (!g_real_egl) { | 14 if (!g_real_egl) { |
15 g_real_egl = new RealEGLApi(); | 15 g_real_egl = new RealEGLApi(); |
16 } | 16 } |
17 g_real_egl->Initialize(&g_driver_egl); | 17 g_real_egl->Initialize(&g_driver_egl); |
18 g_current_egl_context = g_real_egl; | 18 g_current_egl_context = g_real_egl; |
19 } | 19 } |
20 | 20 |
21 void InitializeGLExtensionBindingsEGL(GLContext* context) { | 21 void InitializeGLExtensionBindingsEGL(GLContext* context) { |
22 g_driver_egl.InitializeExtensionBindings(context); | 22 g_driver_egl.InitializeExtensionBindings(context); |
23 } | 23 } |
24 | 24 |
25 void InitializeDebugGLBindingsEGL() { | |
26 g_driver_egl.InitializeDebugBindings(); | |
27 } | |
28 | |
29 void ClearGLBindingsEGL() { | 25 void ClearGLBindingsEGL() { |
30 if (g_real_egl) { | 26 if (g_real_egl) { |
31 delete g_real_egl; | 27 delete g_real_egl; |
32 g_real_egl = NULL; | 28 g_real_egl = NULL; |
33 } | 29 } |
34 g_current_egl_context = NULL; | 30 g_current_egl_context = NULL; |
35 g_driver_egl.ClearBindings(); | 31 g_driver_egl.ClearBindings(); |
36 } | 32 } |
37 | 33 |
38 EGLApi::EGLApi() { | 34 EGLApi::EGLApi() { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (version) | 72 if (version) |
77 info->version = version; | 73 info->version = version; |
78 if (extensions) | 74 if (extensions) |
79 info->extensions = extensions; | 75 info->extensions = extensions; |
80 return true; | 76 return true; |
81 } | 77 } |
82 | 78 |
83 } // namespace gfx | 79 } // namespace gfx |
84 | 80 |
85 | 81 |
OLD | NEW |