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(_EGLDriver
*drv
, _EGLImage
*img
, const EGLint
*attrib_list
)
51 memset(img
, 0, sizeof(_EGLImage
));
53 img
->Preserved
= EGL_FALSE
;
55 err
= _eglParseImageAttribList(img
, attrib_list
);
56 if (err
!= EGL_SUCCESS
)
57 return _eglError(err
, "eglCreateImageKHR");
64 _eglCreateImageKHR(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLContext
*ctx
,
65 EGLenum target
, EGLClientBuffer buffer
,
66 const EGLint
*attr_list
)
68 /* driver should override this function */
74 _eglDestroyImageKHR(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLImage
*image
)
76 /* driver should override this function */
81 #endif /* EGL_KHR_image_base */