Bug 1207437 (part 2) - Don't re-get D3D11CreateDevice. r=dvander.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 24 Sep 2015 15:52:04 -0700
changeset 264261 9aab02e2871ff1ddf5ef854bb432f6d173ae4332
parent 264260 1621dcfac7893af68a7265ce4ae53f1baa89c3f1
child 264262 6e0a245b74925b33ab9546137d6edc0572114cb3
push id65585
push usernnethercote@mozilla.com
push dateThu, 24 Sep 2015 22:52:59 +0000
treeherdermozilla-inbound@6e0a245b7492 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1207437
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1207437 (part 2) - Don't re-get D3D11CreateDevice. r=dvander. It's always obtained during gfxWindowPlatform initialization and put into sD3D11CreateDeviceFn.
gfx/thebes/gfxWindowsPlatform.cpp
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -2480,40 +2480,38 @@ gfxWindowsPlatform::InitializeD2D1()
 
   MOZ_ASSERT(mD2D1Status == FeatureStatus::Available);
   d2d1_1.SetSuccessful();
 }
 
 already_AddRefed<ID3D11Device>
 gfxWindowsPlatform::CreateD3D11DecoderDevice()
 {
-  nsModuleHandle d3d11Module(LoadLibrarySystem32(L"d3d11.dll"));
-  decltype(D3D11CreateDevice)* d3d11CreateDevice = (decltype(D3D11CreateDevice)*)
-    GetProcAddress(d3d11Module, "D3D11CreateDevice");
-
-   if (!d3d11CreateDevice) {
+   if (!sD3D11CreateDeviceFn) {
     // We should just be on Windows Vista or XP in this case.
     return nullptr;
   }
 
   RefPtr<IDXGIAdapter1> adapter = GetDXGIAdapter();
 
   if (!adapter) {
     return nullptr;
   }
 
   HRESULT hr = E_INVALIDARG;
 
   RefPtr<ID3D11Device> device;
 
   MOZ_SEH_TRY{
-    hr = d3d11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr,
-                           D3D11_CREATE_DEVICE_VIDEO_SUPPORT,
-                           mFeatureLevels.Elements(), mFeatureLevels.Length(),
-                           D3D11_SDK_VERSION, byRef(device), nullptr, nullptr);
+    hr = sD3D11CreateDeviceFn(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr,
+                              D3D11_CREATE_DEVICE_VIDEO_SUPPORT,
+                              mFeatureLevels.Elements(),
+                              mFeatureLevels.Length(),
+                              D3D11_SDK_VERSION, byRef(device),
+                              nullptr, nullptr);
   } MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
     return nullptr;
   }
 
   if (FAILED(hr) || !DoesD3D11DeviceWork()) {
     return nullptr;
   }