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 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.

- Keep the change, and instead #ifdef XP_OSX the callers inside gecko. This keeps Moz2D cleaner, at the expense of gecko.

- Come up with some definition of 'close enough to opaque to get away with subpixel AA' and have gecko compute this instead of looking for completely opaque background. I have no idea what that definition would be exactly.

- Others?

Does anyone have any suggestions for this, or knowledge about why only GDI bothered with this previously?

Thanks!

- Matt


[1] http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxASurface.h#136 or http://mxr.mozilla.org/mozilla-central/source/gfx/2d/2D.h#957
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to