From 50d1285ba1a620b96bb89155be5f07c603d3ab48 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 12 Jan 2012 20:24:48 +0000 Subject: [PATCH] Updates in line with latest wayland protocol The shm buffer format enum values were renamed and the explicitly premultiplied format was dropped since it's now assumed if the buffer has an alpha component then it's premultiplied. --- cogl/cogl-texture-2d.c | 12 +++--------- examples/cogland.c | 10 ++++------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c index ba4c6d086..3350dc166 100644 --- a/cogl/cogl-texture-2d.c +++ b/cogl/cogl-texture-2d.c @@ -507,24 +507,18 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx, switch (wl_shm_buffer_get_format (buffer)) { #if G_BYTE_ORDER == G_BIG_ENDIAN - case WL_SHM_FORMAT_PREMULTIPLIED_ARGB32: + case WL_SHM_FORMAT_ARGB8888: format = COGL_PIXEL_FORMAT_ARGB_8888_PRE; break; - case WL_SHM_FORMAT_ARGB32: - format = COGL_PIXEL_FORMAT_ARGB_8888; - break; case WL_SHM_FORMAT_XRGB32: format = COGL_PIXEL_FORMAT_ARGB_8888; internal_format = COGL_PIXEL_FORMAT_RGB_888; break; #elif G_BYTE_ORDER == G_LITTLE_ENDIAN - case WL_SHM_FORMAT_PREMULTIPLIED_ARGB32: + case WL_SHM_FORMAT_ARGB8888: format = COGL_PIXEL_FORMAT_BGRA_8888_PRE; break; - case WL_SHM_FORMAT_ARGB32: - format = COGL_PIXEL_FORMAT_BGRA_8888; - break; - case WL_SHM_FORMAT_XRGB32: + case WL_SHM_FORMAT_XRGB8888: format = COGL_PIXEL_FORMAT_BGRA_8888; internal_format = COGL_PIXEL_FORMAT_BGR_888; break; diff --git a/examples/cogland.c b/examples/cogland.c index 03acf398b..3b2fad04d 100644 --- a/examples/cogland.c +++ b/examples/cogland.c @@ -198,19 +198,17 @@ shm_buffer_damaged (struct wl_buffer *wayland_buffer, switch (wl_shm_buffer_get_format (wayland_buffer)) { #if G_BYTE_ORDER == G_BIG_ENDIAN - case WL_SHM_FORMAT_PREMULTIPLIED_ARGB32: + case WL_SHM_FORMAT_ARGB8888: format = COGL_PIXEL_FORMAT_ARGB_8888_PRE; break; - case WL_SHM_FORMAT_ARGB32: - case WL_SHM_FORMAT_XRGB32: + case WL_SHM_FORMAT_XRGB8888: format = COGL_PIXEL_FORMAT_ARGB_8888; break; #elif G_BYTE_ORDER == G_LITTLE_ENDIAN - case WL_SHM_FORMAT_PREMULTIPLIED_ARGB32: + case WL_SHM_FORMAT_ARGB8888: format = COGL_PIXEL_FORMAT_BGRA_8888_PRE; break; - case WL_SHM_FORMAT_ARGB32: - case WL_SHM_FORMAT_XRGB32: + case WL_SHM_FORMAT_XRGB8888: format = COGL_PIXEL_FORMAT_BGRA_8888; break; #endif