| 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 "app/gfx/gl/gl_bindings.h" | 5 #include "app/gfx/gl/gl_bindings.h" |
| 6 #include "app/gfx/gl/gl_implementation.h" | 6 #include "app/gfx/gl/gl_implementation.h" |
| 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 17 matching lines...) Expand all Loading... |
| 28 FilePath module_path; | 28 FilePath module_path; |
| 29 if (!PathService::Get(base::DIR_MODULE, &module_path)) { | 29 if (!PathService::Get(base::DIR_MODULE, &module_path)) { |
| 30 LOG(ERROR) << "PathService::Get failed."; | 30 LOG(ERROR) << "PathService::Get failed."; |
| 31 return false; | 31 return false; |
| 32 } | 32 } |
| 33 | 33 |
| 34 // When using OSMesa, just use OSMesaGetProcAddress to find entry points. | 34 // When using OSMesa, just use OSMesaGetProcAddress to find entry points. |
| 35 base::NativeLibrary library = base::LoadNativeLibrary( | 35 base::NativeLibrary library = base::LoadNativeLibrary( |
| 36 module_path.Append("osmesa.so")); | 36 module_path.Append("osmesa.so")); |
| 37 if (!library) { | 37 if (!library) { |
| 38 DVLOG(1) << "osmesa.so not found"; | 38 VLOG(1) << "osmesa.so not found"; |
| 39 return false; | 39 return false; |
| 40 } | 40 } |
| 41 | 41 |
| 42 GLGetProcAddressProc get_proc_address = | 42 GLGetProcAddressProc get_proc_address = |
| 43 reinterpret_cast<GLGetProcAddressProc>( | 43 reinterpret_cast<GLGetProcAddressProc>( |
| 44 base::GetFunctionPointerFromNativeLibrary( | 44 base::GetFunctionPointerFromNativeLibrary( |
| 45 library, "OSMesaGetProcAddress")); | 45 library, "OSMesaGetProcAddress")); |
| 46 if (!get_proc_address) { | 46 if (!get_proc_address) { |
| 47 LOG(ERROR) << "OSMesaGetProcAddress not found."; | 47 LOG(ERROR) << "OSMesaGetProcAddress not found."; |
| 48 base::UnloadNativeLibrary(library); | 48 base::UnloadNativeLibrary(library); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 return true; | 84 return true; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void InitializeDebugGLBindings() { | 87 void InitializeDebugGLBindings() { |
| 88 InitializeDebugGLBindingsGL(); | 88 InitializeDebugGLBindingsGL(); |
| 89 InitializeDebugGLBindingsOSMESA(); | 89 InitializeDebugGLBindingsOSMESA(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace gfx | 92 } // namespace gfx |
| OLD | NEW |