return EGL_TRUE;
}
+uint32_t
+dri2_format_for_depth(uint32_t depth)
+{
+ switch (depth) {
+ case 16:
+ return __DRI_IMAGE_FORMAT_RGB565;
+ case 24:
+ return __DRI_IMAGE_FORMAT_XRGB8888;
+ case 30:
+ return __DRI_IMAGE_FORMAT_XRGB2101010;
+ case 32:
+ return __DRI_IMAGE_FORMAT_ARGB8888;
+ default:
+ return __DRI_IMAGE_FORMAT_NONE;
+ }
+}
+
+
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
return NULL;
}
- switch (geometry_reply->depth) {
- case 16:
- format = __DRI_IMAGE_FORMAT_RGB565;
- break;
- case 24:
- format = __DRI_IMAGE_FORMAT_XRGB8888;
- break;
- case 30:
- format = __DRI_IMAGE_FORMAT_XRGB2101010;
- break;
- case 32:
- format = __DRI_IMAGE_FORMAT_ARGB8888;
- break;
- default:
+ format = dri2_format_for_depth(geometry_reply->depth);
+
+ if (format == __DRI_IMAGE_FORMAT_NONE) {
_eglError(EGL_BAD_PARAMETER,
"dri2_create_image_khr: unsupported pixmap depth");
free(buffers_reply);
#include "loader.h"
#include "loader_dri3_helper.h"
-static uint32_t
-dri3_format_for_depth(uint32_t depth)
-{
- switch (depth) {
- case 16:
- return __DRI_IMAGE_FORMAT_RGB565;
- case 24:
- return __DRI_IMAGE_FORMAT_XRGB8888;
- case 30:
- return __DRI_IMAGE_FORMAT_XRGB2101010;
- case 32:
- return __DRI_IMAGE_FORMAT_ARGB8888;
- default:
- return __DRI_IMAGE_FORMAT_NONE;
- }
-}
-
static struct dri3_egl_surface *
loader_drawable_to_egl_surface(struct loader_dri3_drawable *draw) {
size_t offset = offsetof(struct dri3_egl_surface, loader_drawable);
return NULL;
}
- format = dri3_format_for_depth(bp_reply->depth);
+ format = dri2_format_for_depth(bp_reply->depth);
if (format == __DRI_IMAGE_FORMAT_NONE) {
_eglError(EGL_BAD_PARAMETER,
"dri3_create_image_khr: unsupported pixmap depth");
return EGL_NO_IMAGE_KHR;
}
- format = dri3_format_for_depth(bp_reply->depth);
+ format = dri2_format_for_depth(bp_reply->depth);
if (format == __DRI_IMAGE_FORMAT_NONE) {
_eglError(EGL_BAD_PARAMETER,
"dri3_create_image_khr: unsupported pixmap depth");