| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/init/gl_initializer.h" | 5 #include "ui/gl/init/gl_initializer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 9 #include "ui/gl/gl_bindings.h" | 8 #include "ui/gl/gl_bindings.h" |
| 10 #include "ui/gl/gl_egl_api_implementation.h" | 9 #include "ui/gl/gl_egl_api_implementation.h" |
| 11 #include "ui/gl/gl_gl_api_implementation.h" | 10 #include "ui/gl/gl_gl_api_implementation.h" |
| 12 #include "ui/gl/gl_implementation_osmesa.h" | 11 #include "ui/gl/gl_implementation_osmesa.h" |
| 13 #include "ui/gl/gl_osmesa_api_implementation.h" | 12 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 14 #include "ui/gl/gl_surface_egl.h" | 13 #include "ui/gl/gl_surface_egl.h" |
| 15 #include "ui/ozone/public/ozone_platform.h" | 14 #include "ui/ozone/public/ozone_platform.h" |
| 16 #include "ui/ozone/public/surface_factory_ozone.h" | 15 #include "ui/ozone/public/surface_factory_ozone.h" |
| 17 | 16 |
| 18 namespace gl { | 17 namespace gl { |
| 19 namespace init { | 18 namespace init { |
| 20 | 19 |
| 21 namespace { | 20 namespace { |
| 22 | 21 |
| 23 ui::SurfaceFactoryOzone* GetSurfaceFactory() { | 22 ui::SurfaceFactoryOzone* GetSurfaceFactory() { |
| 24 return ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); | 23 return ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); |
| 25 } | 24 } |
| 26 | 25 |
| 27 bool InitializeStaticEGLInternal() { | 26 bool InitializeStaticEGLInternal() { |
| 28 if (!GetSurfaceFactory()->LoadEGLGLES2Bindings( | 27 if (!GetSurfaceFactory()->LoadEGLGLES2Bindings()) |
| 29 base::Bind(&AddGLNativeLibrary), | |
| 30 base::Bind(&SetGLGetProcAddressProc))) { | |
| 31 return false; | 28 return false; |
| 32 } | |
| 33 | 29 |
| 34 SetGLImplementation(kGLImplementationEGLGLES2); | 30 SetGLImplementation(kGLImplementationEGLGLES2); |
| 35 InitializeStaticGLBindingsGL(); | 31 InitializeStaticGLBindingsGL(); |
| 36 InitializeStaticGLBindingsEGL(); | 32 InitializeStaticGLBindingsEGL(); |
| 37 | 33 |
| 38 return true; | 34 return true; |
| 39 } | 35 } |
| 40 | 36 |
| 41 } // namespace | 37 } // namespace |
| 42 | 38 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 83 } |
| 88 | 84 |
| 89 void ClearGLBindingsPlatform() { | 85 void ClearGLBindingsPlatform() { |
| 90 ClearGLBindingsEGL(); | 86 ClearGLBindingsEGL(); |
| 91 ClearGLBindingsGL(); | 87 ClearGLBindingsGL(); |
| 92 ClearGLBindingsOSMESA(); | 88 ClearGLBindingsOSMESA(); |
| 93 } | 89 } |
| 94 | 90 |
| 95 } // namespace init | 91 } // namespace init |
| 96 } // namespace gl | 92 } // namespace gl |
| OLD | NEW |