DrawWindow drawing path doesn't use Cleartype parameter settings

REOPENED
Unassigned

Status

()

Core
Graphics
REOPENED
7 years ago
3 years ago

People

(Reporter: jtd, Unassigned)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Bug 642589 enabled prefs for specifying Cleartype rendering parameters.  However, they are not picked up along all codepaths.  It appears that calling DrawWindow on a non-opaque (i.e. default) canvas ignores these parameter settings when rendering.

Steps:

1. Download the linked testcase (it needs privs to use DrawWindow)
2. Run latest trunk
3. Set 'gfx.font_rendering.cleartype_params.enhanced_contrast' to 800
4. Restart the browser
5. Open the local copy of the linked testcase

Result: the rendering shown in the iframe and the image copy produced via DrawWindow show different Cleartype parameter settings, the copy appears to be using system defaults.

Note: setting moz-opaque="true" on the canvas element fixes the problem.

My guess is that we simply missed a codepath in bug 642589.
This is deliberate. A canvas is an RGBA buffer, and you can't store component alpha text in that buffer, so we disable subpixel AA for canvas text.
We could try to render with component alpha where the canvas pixels are already opaque, but that's hard and potentially confusing. moz-opaque seems to be an acceptable workaround. I suggest we WONTFIX this.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WONTFIX
(Reporter)

Comment 3

7 years ago
Created attachment 535262 [details]
screenshot with enhanced_contrast set to 800

(In reply to comment #1)
> This is deliberate. A canvas is an RGBA buffer, and you can't store
> component alpha text in that buffer, so we disable subpixel AA for canvas
> text.

The issue here is how DrawWindow works, not how Canvas text API's function.  The attached screenshot shows that there is clearly subpixel AA text rendered in the DrawWindow case, just not subpixel AA text that respects the Cleartype parameters.  I suggest we figure out the cause for this, then decide whether to WONTFIX it.
(Reporter)

Updated

7 years ago
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Ah, sorry. Fair enough.
QA Contact: thebes → jdaggett
You need to log in before you can comment on or make changes to this bug.