Last Comment Bug 676753 - canvas does not always use subpixel AA when moz-opaque is true
: canvas does not always use subpixel AA when moz-opaque is true
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Windows 7
: -- normal (vote)
: mozilla8
Assigned To: Bas Schouten (:bas.schouten)
:
Mentors:
http://people.mozilla.org/~jdaggett/t...
Depends on:
Blocks: 651858
  Show dependency treegraph
 
Reported: 2011-08-04 22:46 PDT by John Daggett (:jtd)
Modified: 2011-08-16 04:12 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Use cleartype for opaque Azure canvases (3.55 KB, patch)
2011-08-15 17:22 PDT, Bas Schouten (:bas.schouten)
jmuizelaar: review+
Details | Diff | Splinter Review

Description John Daggett (:jtd) 2011-08-04 22:46:38 PDT
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.
Comment 1 Bas Schouten (:bas.schouten) 2011-08-04 23:01:50 PDT
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.
Comment 2 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-08-04 23:09:30 PDT
pdfjs may change that. How hard is this?
Comment 3 John Daggett (:jtd) 2011-08-04 23:11:18 PDT
(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
Comment 4 Bas Schouten (:bas.schouten) 2011-08-04 23:27:36 PDT
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.
Comment 5 John Daggett (:jtd) 2011-08-04 23:36:38 PDT
(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.
Comment 6 Jeff Muizelaar [:jrmuizel] 2011-08-05 07:11:58 PDT
(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.
Comment 7 Bas Schouten (:bas.schouten) 2011-08-15 17:22:05 PDT
Created attachment 553313 [details] [diff] [review]
Use cleartype for opaque Azure canvases

This should give the desired behavior.
Comment 8 Bas Schouten (:bas.schouten) 2011-08-15 19:39:06 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/2e887d0eb40a
Comment 9 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-16 04:12:07 PDT
http://hg.mozilla.org/mozilla-central/rev/2e887d0eb40a

Note You need to log in before you can comment on or make changes to this bug.