summaryrefslogtreecommitdiff
path: root/src/egl/wayland/wayland-drm/wayland-drm.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-01-10 22:16:26 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-01-11 12:16:47 -0500
commit670f182a1f0401f34b1fb7ead50644589737f0d2 (patch)
tree5160c24346db79d47699271e374ddba55be3add5 /src/egl/wayland/wayland-drm/wayland-drm.h
parent765ed3a6a9317607311bac1dcb0edee13ebcee16 (diff)
egl_dri2/wayland: handle creating xrgb8888 images
When creating an EGLImage from a struct wl_buffer * this ensures that we create an XRGB8888 image if the wayland buffer doesn't have an alpha channel. To determine if a wl_buffer has a valid alpha channel this patch adds an internal wayland_drm_buffer_has_alpha() function. It's important to get the internal format for an EGLImage right so that if a GL texture is later created from the image then the GL driver will know if it should sample the alpha from the texture or flatten it to a constant of 1.0. This avoids needing fragment program workarounds in wayland compositors to manually ignore the alpha component of textures created from wayland buffers. krh: Edited to use wl_buffer_get_format() instead of wl_buffer_has_alpha(). Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Diffstat (limited to 'src/egl/wayland/wayland-drm/wayland-drm.h')
-rw-r--r--src/egl/wayland/wayland-drm/wayland-drm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.h b/src/egl/wayland/wayland-drm/wayland-drm.h
index c9a90cad1ba..bec50a5539f 100644
--- a/src/egl/wayland/wayland-drm/wayland-drm.h
+++ b/src/egl/wayland/wayland-drm/wayland-drm.h
@@ -29,6 +29,9 @@ wayland_drm_uninit(struct wl_drm *drm);
int
wayland_buffer_is_drm(struct wl_buffer *buffer);
+uint32_t
+wayland_drm_buffer_get_format(struct wl_buffer *buffer_base);
+
void *
wayland_drm_buffer_get_buffer(struct wl_buffer *buffer);