Closed Bug 596489 Opened 10 years ago Closed 10 years ago

Support permanent device loss with D3D9

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: bas.schouten, Assigned: bas.schouten)

References

Details

Attachments

(3 files)

We should support the device we're currently using permanently being removed somehow (crashes, reinstall, disable, etc.) with the D3D9 layers backend.
This is needed to allow a different DeviceManager to become the default as LayerManagers die and let go of the DeviceManager's they were using.
Attachment #475424 - Flags: review?(jmuizelaar)
blocking2.0: --- → betaN+
Attachment #475422 - Flags: review?(jmuizelaar) → review+
Comment on attachment 475424 [details] [diff] [review]
Part 2: Refactor DeviceManager ownership

>+  mWidget = aWidget;
>+  mCurrentCallbackInfo.Callback = NULL;
>+  mCurrentCallbackInfo.CallbackData = NULL;
>+
>+  if (mDeviceManager && mDeviceManager->Release() == 0) {
>+    mDeviceManager = nsnull;
>+  }

Oops.

>diff --git a/gfx/layers/d3d9/LayerManagerD3D9.h b/gfx/layers/d3d9/LayerManagerD3D9.h
>--- a/gfx/layers/d3d9/LayerManagerD3D9.h
>+++ b/gfx/layers/d3d9/LayerManagerD3D9.h
>   static void OnDeviceManagerDestroy(DeviceManagerD3D9 *aDeviceManager) {
>-    if(aDeviceManager == mDeviceManager)
>-      mDeviceManager = nsnull;
>+    if(aDeviceManager == mDefaultDeviceManager)

missing space after "if ("
Attachment #475424 - Flags: review?(jmuizelaar) → review+
You need to log in before you can comment on or make changes to this bug.