canvas does not always use subpixel AA when moz-opaque is true

RESOLVED FIXED in mozilla8

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jtd, Assigned: bas)

Tracking

Trunk
mozilla8
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
In the latest trunk builds, with Direct2D enabled (i.e. the default with proper driver support), canvas text API's use grayscale antialiasing instead of subpixel AA when moz-opaque is set to true.

Steps:

- With Direct2D enabled, open the testcase URL

Result:

Text drawn into canvas using fillText is drawn with grayscale AA.

If Direct2D is disabled and DirectWrite forced on, subpixel AA is used.
(Assignee)

Comment 1

6 years ago
This is due to Azure. It's fixable, but I believe when doing Azure we said subpixel AA was not a high priority for canvas.
pdfjs may change that. How hard is this?
(Reporter)

Comment 3

6 years ago
(In reply to Bas Schouten (:bas) from comment #1)
> This is due to Azure. It's fixable, but I believe when doing Azure we said
> subpixel AA was not a high priority for canvas.

I think that was made in the context of the *general* case w/o moz-opaque set to true.  We should really try to avoid having features like this that behave differently depending on hardware, that totally sucks for authors:

  moz-opaque=true, D2D    ==>  grayscale AA
  moz-opaque=true, no D2D ==>  subpixel AA
(Assignee)

Comment 4

6 years ago
It shouldn't be hard to change at all (for opaque surfaces).

Fwiw, cleartype already depends on number of parameters (OS and all) so I'd argue that the latter is not -too- big a concern. I.e. cleartype is not a feature by itself in a way, but an improvement to the way text looks. Like a higher DPI screen, etc.
(Reporter)

Comment 5

6 years ago
(In reply to Bas Schouten (:bas) from comment #4)
> It shouldn't be hard to change at all (for opaque surfaces).
> 
> Fwiw, cleartype already depends on number of parameters (OS and all) so I'd
> argue that the latter is not -too- big a concern. I.e. cleartype is not a
> feature by itself in a way, but an improvement to the way text looks. Like a
> higher DPI screen, etc.

Not quite sure what you mean here.  For some use cases Cleartype vs. grayscale rendering authors will decide to do their design differently one way or another.  So it being a big concern or not is really up to the author.  The key problem here is that we have a hardware-dependent inconsistency, we should avoid those if at all possible.
(In reply to Bas Schouten (:bas) from comment #1)
> This is due to Azure. It's fixable, but I believe when doing Azure we said
> subpixel AA was not a high priority for canvas.

I don't remember being in a discussion about that. Either way, since it's easy to fix we should just fix it.
(Assignee)

Updated

6 years ago
Assignee: nobody → bas.schouten
Blocks: 651858
Status: NEW → ASSIGNED
(Assignee)

Comment 7

6 years ago
Created attachment 553313 [details] [diff] [review]
Use cleartype for opaque Azure canvases

This should give the desired behavior.
Attachment #553313 - Flags: review?(jmuizelaar)
Attachment #553313 - Flags: review?(jmuizelaar) → review+
(Assignee)

Comment 8

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/2e887d0eb40a
http://hg.mozilla.org/mozilla-central/rev/2e887d0eb40a
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.