| 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/files/file_path.h" | 7 #include "base/files/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 "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| 11 #include "ui/gl/gl_context_stub_with_extensions.h" | 11 #include "ui/gl/gl_context_stub_with_extensions.h" |
| 12 #include "ui/gl/gl_egl_api_implementation.h" | 12 #include "ui/gl/gl_egl_api_implementation.h" |
| 13 #include "ui/gl/gl_gl_api_implementation.h" | 13 #include "ui/gl/gl_gl_api_implementation.h" |
| 14 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 15 #include "ui/gl/gl_implementation_osmesa.h" | 15 #include "ui/gl/gl_implementation_osmesa.h" |
| 16 #include "ui/gl/gl_osmesa_api_implementation.h" | 16 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gl { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { | 22 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { |
| 23 glClearDepthf(static_cast<GLclampf>(depth)); | 23 glClearDepthf(static_cast<GLclampf>(depth)); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, | 26 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, |
| 27 GLclampd z_far) { | 27 GLclampd z_far) { |
| 28 glDepthRangef(static_cast<GLclampf>(z_near), static_cast<GLclampf>(z_far)); | 28 glDepthRangef(static_cast<GLclampf>(z_near), static_cast<GLclampf>(z_far)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 SetGLGetProcAddressProc(get_proc_address); | 67 SetGLGetProcAddressProc(get_proc_address); |
| 68 AddGLNativeLibrary(egl_library); | 68 AddGLNativeLibrary(egl_library); |
| 69 AddGLNativeLibrary(gles_library); | 69 AddGLNativeLibrary(gles_library); |
| 70 SetGLImplementation(kGLImplementationEGLGLES2); | 70 SetGLImplementation(kGLImplementationEGLGLES2); |
| 71 | 71 |
| 72 InitializeStaticGLBindingsGL(); | 72 InitializeStaticGLBindingsGL(); |
| 73 InitializeStaticGLBindingsEGL(); | 73 InitializeStaticGLBindingsEGL(); |
| 74 | 74 |
| 75 // These two functions take single precision float rather than double | 75 // These two functions take single precision float rather than double |
| 76 // precision float parameters in GLES. | 76 // precision float parameters in GLES. |
| 77 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; | 77 ::gl::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
| 78 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; | 78 ::gl::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
| 79 break; | 79 break; |
| 80 } | 80 } |
| 81 case kGLImplementationOSMesaGL: | 81 case kGLImplementationOSMesaGL: |
| 82 InitializeStaticGLBindingsOSMesaGL(); | 82 InitializeStaticGLBindingsOSMesaGL(); |
| 83 break; | 83 break; |
| 84 case kGLImplementationMockGL: { | 84 case kGLImplementationMockGL: { |
| 85 SetGLImplementation(kGLImplementationMockGL); | 85 SetGLImplementation(kGLImplementationMockGL); |
| 86 InitializeStaticGLBindingsGL(); | 86 InitializeStaticGLBindingsGL(); |
| 87 break; | 87 break; |
| 88 } | 88 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { | 136 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { |
| 137 switch (GetGLImplementation()) { | 137 switch (GetGLImplementation()) { |
| 138 case kGLImplementationEGLGLES2: | 138 case kGLImplementationEGLGLES2: |
| 139 return GetGLWindowSystemBindingInfoEGL(info); | 139 return GetGLWindowSystemBindingInfoEGL(info); |
| 140 default: | 140 default: |
| 141 return false; | 141 return false; |
| 142 } | 142 } |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace gfx | 146 } // namespace gl |
| OLD | NEW |