aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/common
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2012-07-19 09:02:25 -0400
committerKristian Høgsberg <[email protected]>2012-07-19 14:03:17 -0400
commitd7522ed13052a3d30bc4faedce04685263f57933 (patch)
tree9244b66100be41f76dedc4b6a1ab55540ef204a8 /src/gallium/state_trackers/egl/common
parente23bfdb3298ec43ef895121527fb4d79474d7b1b (diff)
wayland: Support EGL_WIDTH and EGL_HEIGHT queries for wl_buffer
We're going to make the public wl_buffer struct as small as possible. Signed-off-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/egl/common')
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_api.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
index b3941f2467b..a73859c0b9d 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -888,7 +888,8 @@ egl_g3d_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *dpy,
if (!wayland_buffer_is_drm(&buffer->buffer))
return EGL_FALSE;
- if (attribute == EGL_TEXTURE_FORMAT) {
+ switch (attribute) {
+ case EGL_TEXTURE_FORMAT:
switch (resource->format) {
case PIPE_FORMAT_B8G8R8A8_UNORM:
*value = EGL_TEXTURE_RGBA;
@@ -899,9 +900,15 @@ egl_g3d_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *dpy,
default:
return EGL_FALSE;
}
+ case EGL_WIDTH:
+ *value = buffer->buffer.width;
+ return EGL_TRUE;
+ case EGL_HEIGHT:
+ *value = buffer->buffer.height;
+ return EGL_TRUE;
+ default:
+ return EGL_FALSE;
}
-
- return EGL_FALSE;
}
#endif /* EGL_WL_bind_wayland_display */