e7a293b3743a9cd5c1cfe8c4de7e40e267dce526
5 #include "eglcurrent.h"
9 #ifdef EGL_KHR_image_base
13 * Parse the list of image attributes and return the proper error code.
16 _eglParseImageAttribList(_EGLImage
*img
, const EGLint
*attrib_list
)
18 EGLint i
, err
= EGL_SUCCESS
;
23 for (i
= 0; attrib_list
[i
] != EGL_NONE
; i
++) {
24 EGLint attr
= attrib_list
[i
++];
25 EGLint val
= attrib_list
[i
];
28 case EGL_IMAGE_PRESERVED_KHR
:
32 err
= EGL_BAD_ATTRIBUTE
;
36 if (err
!= EGL_SUCCESS
) {
37 _eglLog(_EGL_DEBUG
, "bad image attribute 0x%04x", attr
);
47 _eglInitImage(_EGLImage
*img
, _EGLDisplay
*dpy
, const EGLint
*attrib_list
)
51 memset(img
, 0, sizeof(_EGLImage
));
52 img
->Resource
.Display
= dpy
;
54 img
->Preserved
= EGL_FALSE
;
56 err
= _eglParseImageAttribList(img
, attrib_list
);
57 if (err
!= EGL_SUCCESS
)
58 return _eglError(err
, "eglCreateImageKHR");
65 _eglCreateImageKHR(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLContext
*ctx
,
66 EGLenum target
, EGLClientBuffer buffer
,
67 const EGLint
*attr_list
)
69 /* driver should override this function */
75 _eglDestroyImageKHR(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLImage
*image
)
77 /* driver should override this function */
82 #endif /* EGL_KHR_image_base */