| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/native_library.h" | 11 #include "base/native_library.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "ui/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
| 15 #include "ui/gl/gl_egl_api_implementation.h" |
| 16 #include "ui/gl/gl_gl_api_implementation.h" |
| 17 #include "ui/gl/gl_glx_api_implementation.h" |
| 15 #include "ui/gl/gl_implementation.h" | 18 #include "ui/gl/gl_implementation.h" |
| 19 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 16 #include "ui/gl/gl_switches.h" | 20 #include "ui/gl/gl_switches.h" |
| 17 | 21 |
| 18 namespace gfx { | 22 namespace gfx { |
| 19 namespace { | 23 namespace { |
| 20 | 24 |
| 21 // TODO(piman): it should be Desktop GL marshalling from double to float. Today | 25 // TODO(piman): it should be Desktop GL marshalling from double to float. Today |
| 22 // on native GLES, we do float->double->float. | 26 // on native GLES, we do float->double->float. |
| 23 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { | 27 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { |
| 24 glClearDepthf(static_cast<GLclampf>(depth)); | 28 glClearDepthf(static_cast<GLclampf>(depth)); |
| 25 } | 29 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 SetGLGetProcAddressProc(get_proc_address); | 162 SetGLGetProcAddressProc(get_proc_address); |
| 159 AddGLNativeLibrary(egl_library); | 163 AddGLNativeLibrary(egl_library); |
| 160 AddGLNativeLibrary(gles_library); | 164 AddGLNativeLibrary(gles_library); |
| 161 SetGLImplementation(kGLImplementationEGLGLES2); | 165 SetGLImplementation(kGLImplementationEGLGLES2); |
| 162 | 166 |
| 163 InitializeGLBindingsGL(); | 167 InitializeGLBindingsGL(); |
| 164 InitializeGLBindingsEGL(); | 168 InitializeGLBindingsEGL(); |
| 165 | 169 |
| 166 // These two functions take single precision float rather than double | 170 // These two functions take single precision float rather than double |
| 167 // precision float parameters in GLES. | 171 // precision float parameters in GLES. |
| 168 ::gfx::g_glClearDepth = MarshalClearDepthToClearDepthf; | 172 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
| 169 ::gfx::g_glDepthRange = MarshalDepthRangeToDepthRangef; | 173 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
| 170 break; | 174 break; |
| 171 } | 175 } |
| 172 case kGLImplementationMockGL: { | 176 case kGLImplementationMockGL: { |
| 173 SetGLGetProcAddressProc(GetMockGLProcAddress); | 177 SetGLGetProcAddressProc(GetMockGLProcAddress); |
| 174 SetGLImplementation(kGLImplementationMockGL); | 178 SetGLImplementation(kGLImplementationMockGL); |
| 175 InitializeGLBindingsGL(); | 179 InitializeGLBindingsGL(); |
| 176 break; | 180 break; |
| 177 } | 181 } |
| 178 default: | 182 default: |
| 179 return false; | 183 return false; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 ClearGLBindingsEGL(); | 223 ClearGLBindingsEGL(); |
| 220 ClearGLBindingsGL(); | 224 ClearGLBindingsGL(); |
| 221 ClearGLBindingsGLX(); | 225 ClearGLBindingsGLX(); |
| 222 ClearGLBindingsOSMESA(); | 226 ClearGLBindingsOSMESA(); |
| 223 SetGLImplementation(kGLImplementationNone); | 227 SetGLImplementation(kGLImplementationNone); |
| 224 | 228 |
| 225 UnloadGLNativeLibraries(); | 229 UnloadGLNativeLibraries(); |
| 226 } | 230 } |
| 227 | 231 |
| 228 } // namespace gfx | 232 } // namespace gfx |
| OLD | NEW |