| 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/base_paths.h" | 5 #include "base/base_paths.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "ui/gl/gl_bindings.h" | 11 #include "ui/gl/gl_bindings.h" |
| 12 #include "ui/gl/gl_egl_api_implementation.h" |
| 13 #include "ui/gl/gl_gl_api_implementation.h" |
| 12 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 15 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 13 | 16 |
| 14 namespace gfx { | 17 namespace gfx { |
| 15 | 18 |
| 16 namespace { | 19 namespace { |
| 17 | 20 |
| 18 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { | 21 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { |
| 19 glClearDepthf(static_cast<GLclampf>(depth)); | 22 glClearDepthf(static_cast<GLclampf>(depth)); |
| 20 } | 23 } |
| 21 | 24 |
| 22 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, | 25 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 SetGLGetProcAddressProc(get_proc_address); | 79 SetGLGetProcAddressProc(get_proc_address); |
| 77 AddGLNativeLibrary(egl_library); | 80 AddGLNativeLibrary(egl_library); |
| 78 AddGLNativeLibrary(gles_library); | 81 AddGLNativeLibrary(gles_library); |
| 79 SetGLImplementation(kGLImplementationEGLGLES2); | 82 SetGLImplementation(kGLImplementationEGLGLES2); |
| 80 | 83 |
| 81 InitializeGLBindingsGL(); | 84 InitializeGLBindingsGL(); |
| 82 InitializeGLBindingsEGL(); | 85 InitializeGLBindingsEGL(); |
| 83 | 86 |
| 84 // These two functions take single precision float rather than double | 87 // These two functions take single precision float rather than double |
| 85 // precision float parameters in GLES. | 88 // precision float parameters in GLES. |
| 86 ::gfx::g_glClearDepth = MarshalClearDepthToClearDepthf; | 89 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
| 87 ::gfx::g_glDepthRange = MarshalDepthRangeToDepthRangef; | 90 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
| 88 break; | 91 break; |
| 89 } | 92 } |
| 90 case kGLImplementationMockGL: { | 93 case kGLImplementationMockGL: { |
| 91 SetGLGetProcAddressProc(GetMockGLProcAddress); | 94 SetGLGetProcAddressProc(GetMockGLProcAddress); |
| 92 SetGLImplementation(kGLImplementationMockGL); | 95 SetGLImplementation(kGLImplementationMockGL); |
| 93 InitializeGLBindingsGL(); | 96 InitializeGLBindingsGL(); |
| 94 break; | 97 break; |
| 95 } | 98 } |
| 96 default: | 99 default: |
| 97 NOTIMPLEMENTED() << "InitializeGLBindings on Android"; | 100 NOTIMPLEMENTED() << "InitializeGLBindings on Android"; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 123 | 126 |
| 124 void ClearGLBindings() { | 127 void ClearGLBindings() { |
| 125 ClearGLBindingsEGL(); | 128 ClearGLBindingsEGL(); |
| 126 ClearGLBindingsGL(); | 129 ClearGLBindingsGL(); |
| 127 SetGLImplementation(kGLImplementationNone); | 130 SetGLImplementation(kGLImplementationNone); |
| 128 | 131 |
| 129 UnloadGLNativeLibraries(); | 132 UnloadGLNativeLibraries(); |
| 130 } | 133 } |
| 131 | 134 |
| 132 } // namespace gfx | 135 } // namespace gfx |
| OLD | NEW |