OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 case kGLImplementationOSMesaGL: { | 38 case kGLImplementationOSMesaGL: { |
39 FilePath module_path; | 39 FilePath module_path; |
40 if (!PathService::Get(base::DIR_MODULE, &module_path)) { | 40 if (!PathService::Get(base::DIR_MODULE, &module_path)) { |
41 LOG(ERROR) << "PathService::Get failed."; | 41 LOG(ERROR) << "PathService::Get failed."; |
42 return false; | 42 return false; |
43 } | 43 } |
44 | 44 |
45 base::NativeLibrary library = base::LoadNativeLibrary( | 45 base::NativeLibrary library = base::LoadNativeLibrary( |
46 module_path.Append(L"osmesa.dll")); | 46 module_path.Append(L"osmesa.dll")); |
47 if (!library) { | 47 if (!library) { |
48 DVLOG(1) << "osmesa.dll not found"; | 48 VLOG(1) << "osmesa.dll not found"; |
49 return false; | 49 return false; |
50 } | 50 } |
51 | 51 |
52 GLGetProcAddressProc get_proc_address = | 52 GLGetProcAddressProc get_proc_address = |
53 reinterpret_cast<GLGetProcAddressProc>( | 53 reinterpret_cast<GLGetProcAddressProc>( |
54 base::GetFunctionPointerFromNativeLibrary( | 54 base::GetFunctionPointerFromNativeLibrary( |
55 library, "OSMesaGetProcAddress")); | 55 library, "OSMesaGetProcAddress")); |
56 if (!get_proc_address) { | 56 if (!get_proc_address) { |
57 DLOG(ERROR) << "OSMesaGetProcAddress not found."; | 57 DLOG(ERROR) << "OSMesaGetProcAddress not found."; |
58 base::UnloadNativeLibrary(library); | 58 base::UnloadNativeLibrary(library); |
(...skipping 12 matching lines...) Expand all Loading... |
71 FilePath module_path; | 71 FilePath module_path; |
72 if (!PathService::Get(base::DIR_MODULE, &module_path)) | 72 if (!PathService::Get(base::DIR_MODULE, &module_path)) |
73 return false; | 73 return false; |
74 | 74 |
75 // Load libglesv2.dll before libegl.dll because the latter is dependent on | 75 // Load libglesv2.dll before libegl.dll because the latter is dependent on |
76 // the former and if there is another version of libglesv2.dll in the dll | 76 // the former and if there is another version of libglesv2.dll in the dll |
77 // search path, it will get loaded. | 77 // search path, it will get loaded. |
78 base::NativeLibrary gles_library = base::LoadNativeLibrary( | 78 base::NativeLibrary gles_library = base::LoadNativeLibrary( |
79 module_path.Append(L"libglesv2.dll")); | 79 module_path.Append(L"libglesv2.dll")); |
80 if (!gles_library) { | 80 if (!gles_library) { |
81 LOG(ERROR) << "libglesv2.dll not found"; | 81 VLOG(1) << "libglesv2.dll not found"; |
82 return false; | 82 return false; |
83 } | 83 } |
84 | 84 |
85 // When using EGL, first try eglGetProcAddress and then Windows | 85 // When using EGL, first try eglGetProcAddress and then Windows |
86 // GetProcAddress on both the EGL and GLES2 DLLs. | 86 // GetProcAddress on both the EGL and GLES2 DLLs. |
87 base::NativeLibrary egl_library = base::LoadNativeLibrary( | 87 base::NativeLibrary egl_library = base::LoadNativeLibrary( |
88 module_path.Append(L"libegl.dll")); | 88 module_path.Append(L"libegl.dll")); |
89 if (!egl_library) { | 89 if (!egl_library) { |
90 LOG(ERROR) << "libegl.dll not found."; | 90 VLOG(1) << "libegl.dll not found."; |
91 base::UnloadNativeLibrary(gles_library); | 91 base::UnloadNativeLibrary(gles_library); |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 GLGetProcAddressProc get_proc_address = | 95 GLGetProcAddressProc get_proc_address = |
96 reinterpret_cast<GLGetProcAddressProc>( | 96 reinterpret_cast<GLGetProcAddressProc>( |
97 base::GetFunctionPointerFromNativeLibrary( | 97 base::GetFunctionPointerFromNativeLibrary( |
98 egl_library, "eglGetProcAddress")); | 98 egl_library, "eglGetProcAddress")); |
99 if (!get_proc_address) { | 99 if (!get_proc_address) { |
100 LOG(ERROR) << "eglGetProcAddress not found."; | 100 LOG(ERROR) << "eglGetProcAddress not found."; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 void InitializeDebugGLBindings() { | 161 void InitializeDebugGLBindings() { |
162 InitializeDebugGLBindingsEGL(); | 162 InitializeDebugGLBindingsEGL(); |
163 InitializeDebugGLBindingsGL(); | 163 InitializeDebugGLBindingsGL(); |
164 InitializeDebugGLBindingsOSMESA(); | 164 InitializeDebugGLBindingsOSMESA(); |
165 InitializeDebugGLBindingsWGL(); | 165 InitializeDebugGLBindingsWGL(); |
166 } | 166 } |
167 | 167 |
168 } // namespace gfx | 168 } // namespace gfx |
OLD | NEW |