[cairo-bugs] [Bug 102661] Treat color glyph alpha as mask instead of source alpha

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Aug 1 22:48:06 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=102661

--- Comment #10 from Bill Spitzak <spitzak at gmail.com> ---
Cairo was designed to act like the letters were the *mask*. No pixels outside
the letters should be changed no matter what the compositing operation is or
what character is drawn.

Users expect that by default (which means the compositing op is OVER) the emoji
are filled in with their colors.

It is also useful to be able to fill the shapes of the emoji with solid colors,
for effects such as drop shadows. This cannot be done in one step right now.

My recommendation:

* If the op is OVER, then it does what it is doing now.

* If the op is not OVER, then the color of the emoji is ignored. Instead the
alpha of each of them is merged into the mask with the rest of the glyphs, and
then font rendering continues as normal. In particular this allows SOURCE to be
used to fill with a solid color or image.

A different recommendation. This is more consistent, but much harder to
implement, and may be less useful. To draw an emoji produce exactly the same
result as if you did this:

* Intersect the mask with the alpha of the emoji
* Set the source to an opaque *unpremultiplied* version of the emoji's color
* Fill a rectangle that is bigger than the mask.

This produces the same result for OVER as it does now. SOURCE also produces the
same result.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20180801/6d9bcb7f/attachment.html>


More information about the cairo-bugs mailing list