Closed Bug 596494 Opened 10 years ago Closed 10 years ago

Update render mode on device removal


(Core :: Graphics, defect)

Windows 7
Not set



Tracking Status
blocking2.0 --- betaN+


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



(3 files, 1 obsolete file)

We should update the render mode when we detect a device removal from our layer manager, since we should then make sure we can still support the current render mode.
This patch refactors how render-mode works. It removes the pref and adds a direct2d.force-enabled pref so people can still choose to force-enable D2D ignoring blocklists and such. It also wraps all the logic that determines what render mode is used into an UpdateRenderMode function, which can be called at runtime to re-determine the render mode. Existing fonts in the cache might continue using DirectWrite/GDI after direct write usage mode changed, but this should be acceptable for now. It should probably improved in a follow-up.
Attachment #475437 - Flags: review?(jmuizelaar)
Attachment #475438 - Attachment description: Patch 2: Update render mode on device removal → Part 2: Update render mode on device removal
blocking2.0: --- → ?
blocking2.0: ? → betaN+
Comment on attachment 475437 [details] [diff] [review]
Part 1: Refactor and add UpdateRenderMode

This shouldn't use cairo_verify_device() instead it should get the device and do the verification itself.
Attachment #475438 - Attachment description: Part 2: Update render mode on device removal → Part 3: Update render mode on device removal
Updated for get d3d10 device method.
Attachment #475437 - Attachment is obsolete: true
Attachment #475556 - Flags: review?(jmuizelaar)
Attachment #475437 - Flags: review?(jmuizelaar)
Comment on attachment 475555 [details] [diff] [review]
Part 1: Expose method to get the D3D10 device for cairo d2d device

I like the name cairo_d2d_device_get_device() name better.
Attachment #475555 - Flags: review?(jmuizelaar) → review+
Comment on attachment 475556 [details] [diff] [review]
Part 2: Refactor and add UpdateRenderMode v2

>+    if (isVistaOrHigher  && !safeMode &&
>+        (!d2dDisabled && (!d2dBlocked || d2dForceEnabled))) {

This condition is pretty complex. Can we simplify this by either breaking it into multiple conditions or giving names
to subexpressions. i.e the precedence between d2dDisabled and force enabled isn't immediately obvious to me.
Attachment #475556 - Flags: review?(jmuizelaar) → review+
(In reply to comment #9)
Sorry spam, 
Please ignore
You need to log in before you can comment on or make changes to this bug.