mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-10 13:29:48 -05:00
Fix rgb byte order for GdkPixbuf backgrounds.
This commit is contained in:
parent
e10b828562
commit
18fd33c9bb
1 changed files with 9 additions and 1 deletions
|
|
@ -267,6 +267,7 @@ background_create(struct egl_compositor *ec,
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
int pixbuf_width, pixbuf_height;
|
int pixbuf_width, pixbuf_height;
|
||||||
void *data;
|
void *data;
|
||||||
|
GLenum format;
|
||||||
|
|
||||||
background = malloc(sizeof *background);
|
background = malloc(sizeof *background);
|
||||||
if (background == NULL)
|
if (background == NULL)
|
||||||
|
|
@ -290,8 +291,15 @@ background_create(struct egl_compositor *ec,
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
|
if (gdk_pixbuf_get_has_alpha (pixbuf)) {
|
||||||
|
format = GL_RGBA;
|
||||||
|
} else {
|
||||||
|
format = GL_RGB;
|
||||||
|
}
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, pixbuf_width, pixbuf_height, 0,
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, pixbuf_width, pixbuf_height, 0,
|
||||||
GL_BGR, GL_UNSIGNED_BYTE, data);
|
format, GL_UNSIGNED_BYTE, data);
|
||||||
|
|
||||||
background->compositor = ec;
|
background->compositor = ec;
|
||||||
background->map.x = 0;
|
background->map.x = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue