2 * Copyright © 2013 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #include "image_common.h"
27 image_common_unsupported(const char *name
)
29 printf("Function \"%s\" not supported on this implementation\n", name
);
30 piglit_report_result(PIGLIT_SKIP
);
34 resolve_eglCreateImageKHR()
36 if (piglit_is_egl_extension_supported(eglGetCurrentDisplay(),
37 "EGL_KHR_image_base"))
38 image_common_dispatch_eglCreateImageKHR
=
39 (PFNEGLCREATEIMAGEKHRPROC
) eglGetProcAddress(
42 image_common_unsupported("CreateImageKHR");
45 static EGLImageKHR EGLAPIENTRY
46 stub_eglCreateImageKHR(EGLDisplay dpy
, EGLContext ctx
, EGLenum target
,
47 EGLClientBuffer buffer
, const EGLint
*attrib_list
)
49 resolve_eglCreateImageKHR();
50 return image_common_dispatch_eglCreateImageKHR(dpy
, ctx
, target
, buffer
,
54 PFNEGLCREATEIMAGEKHRPROC image_common_dispatch_eglCreateImageKHR
=
55 stub_eglCreateImageKHR
;
58 resolve_eglDestroyImageKHR()
60 if (piglit_is_egl_extension_supported(eglGetCurrentDisplay(),
61 "EGL_KHR_image_base"))
62 image_common_dispatch_eglDestroyImageKHR
=
63 (PFNEGLDESTROYIMAGEKHRPROC
) eglGetProcAddress(
64 "eglDestroyImageKHR");
66 image_common_unsupported("DestroyImageKHR");
69 static EGLBoolean EGLAPIENTRY
70 stub_eglDestroyImageKHR(EGLDisplay dpy
, EGLImageKHR image
)
72 resolve_eglDestroyImageKHR();
73 return image_common_dispatch_eglDestroyImageKHR(dpy
, image
);
76 PFNEGLDESTROYIMAGEKHRPROC image_common_dispatch_eglDestroyImageKHR
=
77 stub_eglDestroyImageKHR
;