[PATCH] screensaver: fix decoding of transparency in xpm files
Kristian Høgsberg
hoegsberg at gmail.com
Thu Sep 6 08:14:06 PDT 2012
On Thu, Sep 06, 2012 at 03:23:28PM +0200, Philipp Brüschweiler wrote:
> Use 0 as transparent pixel. This is needed when using premultiplied
> alpha.
Thanks, committed.
Kristian
> ---
> clients/wscreensaver-glue.c | 6 +++---
> 1 Datei geändert, 3 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)
>
> diff --git a/clients/wscreensaver-glue.c b/clients/wscreensaver-glue.c
> index a548599..55d0a8c 100644
> --- a/clients/wscreensaver-glue.c
> +++ b/clients/wscreensaver-glue.c
> @@ -80,14 +80,14 @@ read_xpm_color(uint32_t *ctable, const char *line)
> value = strtol(&cstr[1], &end, 16);
>
> if (strcmp(cstr, "None") == 0)
> - ctable[key] = 0x00ffffff;
> + ctable[key] = 0x00000000;
> else if (cstr[0] != '#' || !(cstr[1] != '\0' && *end == '\0')) {
> fprintf(stderr, "%s: error interpreting XPM color '%s'\n",
> progname, cstr);
> return;
> + } else {
> + ctable[key] = value | 0xff000000;
> }
> -
> - ctable[key] = value | 0xff000000;
> }
>
> static void
> --
> 1.7.12
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list