| Index: ui/gl/gl_gl_api_implementation.cc
|
| diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
|
| index 9184fc3066a0e43fabfbc3e83f1c66267be0ec22..e08900b2b84f50788723fade79e5df0ef3c368fa 100644
|
| --- a/ui/gl/gl_gl_api_implementation.cc
|
| +++ b/ui/gl/gl_gl_api_implementation.cc
|
| @@ -14,6 +14,7 @@
|
| #include "ui/gl/gl_state_restorer.h"
|
| #include "ui/gl/gl_surface.h"
|
| #include "ui/gl/gl_switches.h"
|
| +#include "ui/gl/gl_version_info.h"
|
|
|
| namespace gfx {
|
|
|
| @@ -23,6 +24,8 @@ static GLApi* g_gl;
|
| static RealGLApi* g_real_gl;
|
| // A GL Api that calls TRACE and then calls another GL api.
|
| static TraceGLApi* g_trace_gl;
|
| +// GL version used when initializing dynamic bindings.
|
| +static GLVersionInfo* g_version_info = NULL;
|
|
|
| namespace {
|
|
|
| @@ -40,7 +43,9 @@ static inline GLenum GetTexInternalFormat(GLenum internal_format,
|
| GLenum type) {
|
| GLenum gl_internal_format = GetInternalFormat(internal_format);
|
|
|
| - if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
|
| + // g_version_info must be initialized when this function is bound.
|
| + DCHECK(gfx::g_version_info);
|
| + if (gfx::g_version_info->is_es)
|
| return gl_internal_format;
|
|
|
| if (type == GL_FLOAT) {
|
| @@ -208,6 +213,8 @@ void SetGLToRealGLApi() {
|
|
|
| void InitializeDynamicGLBindingsGL(GLContext* context) {
|
| g_driver_gl.InitializeCustomDynamicBindings(context);
|
| + DCHECK(context && context->IsCurrent(NULL) && !g_version_info);
|
| + g_version_info = new GLVersionInfo(context->GetGLVersion().c_str());
|
| }
|
|
|
| void InitializeDebugGLBindingsGL() {
|
| @@ -233,6 +240,10 @@ void ClearGLBindingsGL() {
|
| delete g_current_gl_context_tls;
|
| g_current_gl_context_tls = NULL;
|
| }
|
| + if (g_version_info) {
|
| + delete g_version_info;
|
| + g_version_info = NULL;
|
| + }
|
| }
|
|
|
| GLApi::GLApi() {
|
|
|