Index: content/gpu/gpu_info_collector_win.cc |
=================================================================== |
--- content/gpu/gpu_info_collector_win.cc (revision 186491) |
+++ content/gpu/gpu_info_collector_win.cc (working copy) |
@@ -199,14 +199,7 @@ |
AMDVideoCardType GetAMDVideocardType(); |
#endif |
-// Collects information about the level of D3D11 support and records it in |
-// the UMA stats. Records no stats when D3D11 in not supported at all. |
-// |
-// http://crbug.com/175525. Using D3D11 seems to crash when dlumd32.dll is |
-// loaded. This function is not currently called. |
-void CollectD3D11Support(HMODULE d3d11_module) { |
- TRACE_EVENT0("gpu", "CollectD3D11Support"); |
- |
+void CollectD3D11Support() { |
typedef HRESULT (WINAPI *D3D11CreateDeviceFunc)( |
IDXGIAdapter* adapter, |
D3D_DRIVER_TYPE driver_type, |
@@ -235,15 +228,27 @@ |
NUM_FEATURE_LEVELS |
}; |
+ TRACE_EVENT0("gpu", "CollectD3D11Support"); |
+ |
+ // Windows XP is expected to not support D3D11. |
+ if (base::win::GetVersion() <= base::win::VERSION_XP) |
+ return; |
+ |
FeatureLevel feature_level = FEATURE_LEVEL_UNKNOWN; |
UINT bgra_support = 0; |
+ // This is leaked in case it is hooked by a third party DLL. |
+ base::NativeLibrary d3d11_module = base::LoadNativeLibrary( |
+ base::FilePath(L"d3d11.dll"), |
+ NULL); |
+ |
if (!d3d11_module) { |
feature_level = FEATURE_LEVEL_NO_D3D11_DLL; |
} else { |
D3D11CreateDeviceFunc create_func = |
reinterpret_cast<D3D11CreateDeviceFunc>( |
- GetProcAddress(d3d11_module, "D3D11CreateDevice")); |
+ base::GetFunctionPointerFromNativeLibrary(d3d11_module, |
+ "D3D11CreateDevice")); |
if (!create_func) { |
feature_level = FEATURE_LEVEL_NO_CREATE_DEVICE_ENTRY_POINT; |
} else { |
@@ -320,24 +325,6 @@ |
(bgra_support & D3D11_FORMAT_SUPPORT_RENDER_TARGET) != 0); |
} |
-void CollectD3D11SupportDelayed( |
- const scoped_refptr<base::MessageLoopProxy> main_loop) { |
- // Windows XP is expected to not support D3D11. |
- if (base::win::GetVersion() <= base::win::VERSION_XP) |
- return; |
- |
- // This is leaked in case it is hooked by a third party DLL. |
- HMODULE d3d11_module = LoadLibrary(L"d3d11.dll"); |
- |
- // Collect the D3D11 stats after a delay to allow third party DLLs |
- // to hook D3D11 before we try to use it. Also do it on the main thread |
- // in case the third party DLL does this on the main thread. |
- main_loop->PostDelayedTask( |
- FROM_HERE, |
- base::Bind(CollectD3D11Support, d3d11_module), |
- base::TimeDelta::FromSeconds(10)); |
-} |
- |
bool CollectDriverInfoD3D(const std::wstring& device_id, |
content::GPUInfo* gpu_info) { |
TRACE_EVENT0("gpu", "CollectDriverInfoD3D"); |