| 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 "base/bind.h" |
| 5 #include "ui/gfx/ozone/surface_factory_ozone.h" | 6 #include "ui/gfx/ozone/surface_factory_ozone.h" |
| 6 #include "ui/gl/gl_bindings.h" | 7 #include "ui/gl/gl_bindings.h" |
| 7 #include "ui/gl/gl_egl_api_implementation.h" | 8 #include "ui/gl/gl_egl_api_implementation.h" |
| 8 #include "ui/gl/gl_gl_api_implementation.h" | 9 #include "ui/gl/gl_gl_api_implementation.h" |
| 9 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
| 10 #include "ui/gl/gl_implementation_linux.h" | 11 #include "ui/gl/gl_implementation_linux.h" |
| 11 #include "ui/gl/gl_osmesa_api_implementation.h" | 12 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 | 15 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 34 // Prevent reinitialization with a different implementation. Once the gpu | 35 // Prevent reinitialization with a different implementation. Once the gpu |
| 35 // unit tests have initialized with kGLImplementationMock, we don't want to | 36 // unit tests have initialized with kGLImplementationMock, we don't want to |
| 36 // later switch to another GL implementation. | 37 // later switch to another GL implementation. |
| 37 if (GetGLImplementation() != kGLImplementationNone) | 38 if (GetGLImplementation() != kGLImplementationNone) |
| 38 return true; | 39 return true; |
| 39 | 40 |
| 40 switch (implementation) { | 41 switch (implementation) { |
| 41 case kGLImplementationOSMesaGL: | 42 case kGLImplementationOSMesaGL: |
| 42 return InitializeGLBindingsOSMesaGL(); | 43 return InitializeGLBindingsOSMesaGL(); |
| 43 case kGLImplementationEGLGLES2: | 44 case kGLImplementationEGLGLES2: |
| 44 if (!gfx::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings()) | 45 if (!gfx::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings( |
| 46 base::Bind(&AddGLNativeLibrary), |
| 47 base::Bind(&SetGLGetProcAddressProc))) |
| 45 return false; | 48 return false; |
| 46 SetGLImplementation(kGLImplementationEGLGLES2); | 49 SetGLImplementation(kGLImplementationEGLGLES2); |
| 47 InitializeGLBindingsGL(); | 50 InitializeGLBindingsGL(); |
| 48 InitializeGLBindingsEGL(); | 51 InitializeGLBindingsEGL(); |
| 49 | 52 |
| 50 // These two functions take single precision float rather than double | 53 // These two functions take single precision float rather than double |
| 51 // precision float parameters in GLES. | 54 // precision float parameters in GLES. |
| 52 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; | 55 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
| 53 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; | 56 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
| 54 break; | 57 break; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 switch (GetGLImplementation()) { | 105 switch (GetGLImplementation()) { |
| 103 case kGLImplementationEGLGLES2: | 106 case kGLImplementationEGLGLES2: |
| 104 return GetGLWindowSystemBindingInfoEGL(info); | 107 return GetGLWindowSystemBindingInfoEGL(info); |
| 105 default: | 108 default: |
| 106 return false; | 109 return false; |
| 107 } | 110 } |
| 108 return false; | 111 return false; |
| 109 } | 112 } |
| 110 | 113 |
| 111 } // namespace gfx | 114 } // namespace gfx |
| OLD | NEW |