On Jan 20, 2014, at 5:48 PM, Matt Woodrow <m...@mozilla.com> wrote:

> Hi,
> 
> Currently in gecko we have code to determine if text being drawn into a 
> transparent surface has opaque content underneath it. In the case where it 
> doesn't we ask moz2d/cairo [1] to disable subpixel AA text rendering for this 
> surface since it can have poor results depending on what the eventual 
> background color is.
> 
> However, this setting was only ever respected for the GDI font rendering 
> backend with cairo, and the other backends ignored it (unless they do 
> something internally?). Moz2D matched this until recently, until bug 941095 
> made the CoreGraphics backend start respecting the value as well.
> 
> The two extreme examples of where this might matter are as follows:
> 
> - A transparent surface with a very nearly opaque background color (the OSX 
> content menus uses rgba(255,255,255,0.95) iirc). In this case it's probably 
> ok to use subpixel AA since we're so close to opaque. The OSX context menu's 
> used to get subpixel AA text in this case since the value was ignored, but no 
> longer do (on nightly) since we respect the value.
> 
> - A fully transparent surface containing only text. It should be fairly easy 
> to get this to happen by 3d transforming a <text> element. I suspect we don't 
> want subpixel AA here, since we have no idea what the final background color 
> might be (and it could change every frame if the transform is animated). CG 
> was previously still giving us subpixel AA in this case, but won't be any 
> more.

I suspect Safari will drop the sub pixel AA in this case and we should to.

> I doubt we want to ship the text quality regression for OSX context menus, so 
> we need to find a solution to this. Preferably something that is consistent 
> across backends :)
> 
> Possible ideas:
> 
> - Revert the change to the Moz2D CG backend. This takes us back to matching 
> our previous behaviour, but not ideal to have Moz2D API functions that are 
> ignored on some backends.

I’d suggest we do this for now. OS X supports drawing subpixel-AA to partially 
transparent surfaces. I believe the amount of sub pixel AA depends on the alpha 
of the surface. (Imagine drawing sub-pixel aa text to a transparency group to 
get an idea of how this would work)

On OS X we really only want to be disabling subpixel-AA when were drawing to 
surface that currently or will be not pixel aligned.

-Jeff

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to