| 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 "base/bind.h" |
| 6 #include "ui/gl/gl_bindings.h" | 6 #include "ui/gl/gl_bindings.h" |
| 7 #include "ui/gl/gl_context_stub_with_extensions.h" | 7 #include "ui/gl/gl_context_stub_with_extensions.h" |
| 8 #include "ui/gl/gl_egl_api_implementation.h" | 8 #include "ui/gl/gl_egl_api_implementation.h" |
| 9 #include "ui/gl/gl_gl_api_implementation.h" | 9 #include "ui/gl/gl_gl_api_implementation.h" |
| 10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
| 11 #include "ui/gl/gl_implementation_osmesa.h" | 11 #include "ui/gl/gl_implementation_osmesa.h" |
| 12 #include "ui/gl/gl_osmesa_api_implementation.h" | 12 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 13 #include "ui/ozone/public/ozone_platform.h" | 13 #include "ui/ozone/public/ozone_platform.h" |
| 14 #include "ui/ozone/public/surface_factory_ozone.h" | 14 #include "ui/ozone/public/surface_factory_ozone.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gl { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { | 20 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { |
| 21 glClearDepthf(static_cast<GLclampf>(depth)); | 21 glClearDepthf(static_cast<GLclampf>(depth)); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, | 24 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, |
| 25 GLclampd z_far) { | 25 GLclampd z_far) { |
| 26 glDepthRangef(static_cast<GLclampf>(z_near), static_cast<GLclampf>(z_far)); | 26 glDepthRangef(static_cast<GLclampf>(z_near), static_cast<GLclampf>(z_far)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 48 ->GetSurfaceFactoryOzone() | 48 ->GetSurfaceFactoryOzone() |
| 49 ->LoadEGLGLES2Bindings(base::Bind(&AddGLNativeLibrary), | 49 ->LoadEGLGLES2Bindings(base::Bind(&AddGLNativeLibrary), |
| 50 base::Bind(&SetGLGetProcAddressProc))) | 50 base::Bind(&SetGLGetProcAddressProc))) |
| 51 return false; | 51 return false; |
| 52 SetGLImplementation(kGLImplementationEGLGLES2); | 52 SetGLImplementation(kGLImplementationEGLGLES2); |
| 53 InitializeStaticGLBindingsGL(); | 53 InitializeStaticGLBindingsGL(); |
| 54 InitializeStaticGLBindingsEGL(); | 54 InitializeStaticGLBindingsEGL(); |
| 55 | 55 |
| 56 // These two functions take single precision float rather than double | 56 // These two functions take single precision float rather than double |
| 57 // precision float parameters in GLES. | 57 // precision float parameters in GLES. |
| 58 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; | 58 ::gl::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
| 59 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; | 59 ::gl::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
| 60 break; | 60 break; |
| 61 case kGLImplementationMockGL: { | 61 case kGLImplementationMockGL: { |
| 62 SetGLImplementation(kGLImplementationMockGL); | 62 SetGLImplementation(kGLImplementationMockGL); |
| 63 InitializeStaticGLBindingsGL(); | 63 InitializeStaticGLBindingsGL(); |
| 64 break; | 64 break; |
| 65 } | 65 } |
| 66 default: | 66 default: |
| 67 NOTIMPLEMENTED() | 67 NOTIMPLEMENTED() |
| 68 << "Unsupported GL type for Ozone surface implementation"; | 68 << "Unsupported GL type for Ozone surface implementation"; |
| 69 return false; | 69 return false; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { | 113 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { |
| 114 switch (GetGLImplementation()) { | 114 switch (GetGLImplementation()) { |
| 115 case kGLImplementationEGLGLES2: | 115 case kGLImplementationEGLGLES2: |
| 116 return GetGLWindowSystemBindingInfoEGL(info); | 116 return GetGLWindowSystemBindingInfoEGL(info); |
| 117 default: | 117 default: |
| 118 return false; | 118 return false; |
| 119 } | 119 } |
| 120 return false; | 120 return false; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace gfx | 123 } // namespace gl |
| OLD | NEW |