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/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/gl/gl_gl_api_implementation.h" | 25 #include "ui/gl/gl_gl_api_implementation.h" |
26 #include "ui/gl/gl_implementation.h" | 26 #include "ui/gl/gl_implementation.h" |
27 #include "ui/gl/gl_osmesa_api_implementation.h" | 27 #include "ui/gl/gl_osmesa_api_implementation.h" |
28 #include "ui/gl/gl_surface_wgl.h" | 28 #include "ui/gl/gl_surface_wgl.h" |
29 #include "ui/gl/gl_wgl_api_implementation.h" | 29 #include "ui/gl/gl_wgl_api_implementation.h" |
30 | 30 |
31 #if defined(ENABLE_SWIFTSHADER) | 31 #if defined(ENABLE_SWIFTSHADER) |
32 #include "software_renderer.h" | 32 #include "software_renderer.h" |
33 #endif | 33 #endif |
34 | 34 |
35 namespace gfx { | 35 namespace gl { |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 const wchar_t kD3DCompiler[] = L"D3DCompiler_47.dll"; | 39 const wchar_t kD3DCompiler[] = L"D3DCompiler_47.dll"; |
40 | 40 |
41 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { | 41 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { |
42 glClearDepthf(static_cast<GLclampf>(depth)); | 42 glClearDepthf(static_cast<GLclampf>(depth)); |
43 } | 43 } |
44 | 44 |
45 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, | 45 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 SetGLGetProcAddressProc(get_proc_address); | 208 SetGLGetProcAddressProc(get_proc_address); |
209 AddGLNativeLibrary(egl_library); | 209 AddGLNativeLibrary(egl_library); |
210 AddGLNativeLibrary(gles_library); | 210 AddGLNativeLibrary(gles_library); |
211 SetGLImplementation(kGLImplementationEGLGLES2); | 211 SetGLImplementation(kGLImplementationEGLGLES2); |
212 | 212 |
213 InitializeStaticGLBindingsGL(); | 213 InitializeStaticGLBindingsGL(); |
214 InitializeStaticGLBindingsEGL(); | 214 InitializeStaticGLBindingsEGL(); |
215 | 215 |
216 // These two functions take single precision float rather than double | 216 // These two functions take single precision float rather than double |
217 // precision float parameters in GLES. | 217 // precision float parameters in GLES. |
218 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; | 218 ::gl::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; |
219 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; | 219 ::gl::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; |
220 break; | 220 break; |
221 } | 221 } |
222 case kGLImplementationDesktopGL: { | 222 case kGLImplementationDesktopGL: { |
223 base::NativeLibrary library = base::LoadNativeLibrary( | 223 base::NativeLibrary library = base::LoadNativeLibrary( |
224 base::FilePath(L"opengl32.dll"), NULL); | 224 base::FilePath(L"opengl32.dll"), NULL); |
225 if (!library) { | 225 if (!library) { |
226 DVLOG(1) << "opengl32.dll not found"; | 226 DVLOG(1) << "opengl32.dll not found"; |
227 return false; | 227 return false; |
228 } | 228 } |
229 | 229 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 switch (GetGLImplementation()) { | 345 switch (GetGLImplementation()) { |
346 case kGLImplementationDesktopGL: | 346 case kGLImplementationDesktopGL: |
347 return GetGLWindowSystemBindingInfoWGL(info); | 347 return GetGLWindowSystemBindingInfoWGL(info); |
348 case kGLImplementationEGLGLES2: | 348 case kGLImplementationEGLGLES2: |
349 return GetGLWindowSystemBindingInfoEGL(info); | 349 return GetGLWindowSystemBindingInfoEGL(info); |
350 default: | 350 default: |
351 return false; | 351 return false; |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 } // namespace gfx | 355 } // namespace gl |
OLD | NEW |