gdk: Make A8 and A16 formats premultiplied
authorBenjamin Otte <otte@redhat.com>
Fri, 21 Jul 2023 23:29:24 +0000 (01:29 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 21 Jul 2023 23:33:44 +0000 (01:33 +0200)
commit4a8122f6859f268bc886133164b5d055a2c89bad
tree7c7ee58395060c31db751d0ccfaa3297c76199b3
parent7a58439977440522d20799fc1bacbcb822886ba4
gdk: Make A8 and A16 formats premultiplied

The relevant question here is about details, because we have to choose
if we declare alpha-only formats as having their (nonexistant) color
channels premultiplied or not, so that the code paths using them can do
the right thing.

Because we are premultiplied by default, it makes sense to treat alpha
like that, because then the alpha-only code doesn't need to do
workarounds for straight alpha.

Where this is relevant of course is when expanding the alpha channel
into color channels, where we want to end up with white.
So make sure we do color = alpha there instead of color = 1 like we did
before.
gdk/gdkmemoryformat.c
testsuite/gdk/memorytexture.c