| 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 | 7 |
| 7 namespace gfx { | 8 namespace gfx { |
| 8 | 9 |
| 9 RealEGLApi* g_real_egl; | 10 RealEGLApi* g_real_egl; |
| 10 | 11 |
| 11 void InitializeGLBindingsEGL() { | 12 void InitializeGLBindingsEGL() { |
| 12 g_driver_egl.InitializeBindings(); | 13 g_driver_egl.InitializeBindings(); |
| 13 if (!g_real_egl) { | 14 if (!g_real_egl) { |
| 14 g_real_egl = new RealEGLApi(); | 15 g_real_egl = new RealEGLApi(); |
| 15 } | 16 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 RealEGLApi::~RealEGLApi() { | 58 RealEGLApi::~RealEGLApi() { |
| 58 } | 59 } |
| 59 | 60 |
| 60 void RealEGLApi::Initialize(DriverEGL* driver) { | 61 void RealEGLApi::Initialize(DriverEGL* driver) { |
| 61 InitializeBase(driver); | 62 InitializeBase(driver); |
| 62 } | 63 } |
| 63 | 64 |
| 64 TraceEGLApi::~TraceEGLApi() { | 65 TraceEGLApi::~TraceEGLApi() { |
| 65 } | 66 } |
| 66 | 67 |
| 68 bool GetGLWindowSystemBindingInfoEGL(GLWindowSystemBindingInfo* info) { |
| 69 EGLDisplay display = eglGetCurrentDisplay(); |
| 70 const char* vendor = eglQueryString(display, EGL_VENDOR); |
| 71 const char* version = eglQueryString(display, EGL_VERSION); |
| 72 const char* extensions = eglQueryString(display, EGL_EXTENSIONS); |
| 73 *info = GLWindowSystemBindingInfo(); |
| 74 if (vendor) |
| 75 info->vendor = vendor; |
| 76 if (version) |
| 77 info->version = version; |
| 78 if (extensions) |
| 79 info->extensions = extensions; |
| 80 return true; |
| 81 } |
| 82 |
| 67 } // namespace gfx | 83 } // namespace gfx |
| 68 | 84 |
| 69 | 85 |
| OLD | NEW |