Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ui/gfx/gl/gl_implementation_win.cc

Issue 6864020: linux: don't always print dlopen errors from LoadNativeLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: owners Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_implementation_mac.cc ('k') | webkit/plugins/npapi/plugin_lib.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 25 matching lines...) Expand all
36 36
37 switch (implementation) { 37 switch (implementation) {
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"), NULL);
47 if (!library) { 47 if (!library) {
48 VLOG(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) {
(...skipping 12 matching lines...) Expand all
69 } 69 }
70 case kGLImplementationEGLGLES2: { 70 case kGLImplementationEGLGLES2: {
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"), NULL);
80 if (!gles_library) { 80 if (!gles_library) {
81 VLOG(1) << "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"), NULL);
89 if (!egl_library) { 89 if (!egl_library) {
90 VLOG(1) << "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"));
(...skipping 15 matching lines...) Expand all
114 // These two functions take single precision float rather than double 114 // These two functions take single precision float rather than double
115 // precision float parameters in GLES. 115 // precision float parameters in GLES.
116 ::gfx::g_glClearDepth = MarshalClearDepthToClearDepthf; 116 ::gfx::g_glClearDepth = MarshalClearDepthToClearDepthf;
117 ::gfx::g_glDepthRange = MarshalDepthRangeToDepthRangef; 117 ::gfx::g_glDepthRange = MarshalDepthRangeToDepthRangef;
118 break; 118 break;
119 } 119 }
120 case kGLImplementationDesktopGL: { 120 case kGLImplementationDesktopGL: {
121 // When using Windows OpenGL, first try wglGetProcAddress and then 121 // When using Windows OpenGL, first try wglGetProcAddress and then
122 // Windows GetProcAddress. 122 // Windows GetProcAddress.
123 base::NativeLibrary library = base::LoadNativeLibrary( 123 base::NativeLibrary library = base::LoadNativeLibrary(
124 FilePath(L"opengl32.dll")); 124 FilePath(L"opengl32.dll"), NULL);
125 if (!library) { 125 if (!library) {
126 VLOG(1) << "opengl32.dll not found"; 126 VLOG(1) << "opengl32.dll not found";
127 return false; 127 return false;
128 } 128 }
129 129
130 GLGetProcAddressProc get_proc_address = 130 GLGetProcAddressProc get_proc_address =
131 reinterpret_cast<GLGetProcAddressProc>( 131 reinterpret_cast<GLGetProcAddressProc>(
132 base::GetFunctionPointerFromNativeLibrary( 132 base::GetFunctionPointerFromNativeLibrary(
133 library, "wglGetProcAddress")); 133 library, "wglGetProcAddress"));
134 if (!get_proc_address) { 134 if (!get_proc_address) {
(...skipping 24 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_implementation_mac.cc ('k') | webkit/plugins/npapi/plugin_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698