Closed Bug 676753 Opened 13 years ago Closed 13 years ago

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

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: jtd, Assigned: bas.schouten)

References

()

Details

Attachments

(1 file)

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.
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?
(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
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.
(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: nobody → bas.schouten
Blocks: 651858
Status: NEW → ASSIGNED
This should give the desired behavior.
Attachment #553313 - Flags: review?(jmuizelaar)
Attachment #553313 - Flags: review?(jmuizelaar) → review+
http://hg.mozilla.org/mozilla-central/rev/2e887d0eb40a
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: