.done = wayland_throttle_callback
};
+static EGLBoolean
+get_fourcc(struct dri2_egl_display *dri2_dpy,
+ __DRIimage *image, int *fourcc)
+{
+ EGLBoolean query;
+ uint32_t dri_format;
+
+ query = dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FOURCC,
+ fourcc);
+ if (query)
+ return true;
+
+ query = dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FORMAT,
+ &dri_format);
+ if (!query)
+ return false;
+
+ switch (dri_format) {
+ case __DRI_IMAGE_FORMAT_ARGB8888:
+ *fourcc = __DRI_IMAGE_FOURCC_ARGB8888;
+ return true;
+ case __DRI_IMAGE_FORMAT_XRGB8888:
+ *fourcc = __DRI_IMAGE_FOURCC_XRGB8888;
+ return true;
+ default:
+ return false;
+ }
+}
+
static struct wl_buffer *
create_wl_buffer(struct dri2_egl_display *dri2_dpy,
struct dri2_egl_surface *dri2_surf,
query = dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_WIDTH, &width);
query &= dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_HEIGHT,
&height);
- query &= dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FOURCC,
- &fourcc);
+ query &= get_fourcc(dri2_dpy, image, &fourcc);
if (!query)
return NULL;