toytoolkit: fix EGL surface creation for lazy drivers

Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.

Allow toytoolkit to create EGL surfaces with them, by
falling back to the old creation method.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Manuel Bachmann 2015-03-29 08:17:01 +02:00 committed by Pekka Paalanen
parent 56d9b88e69
commit 5d1d2ca325

View File

@ -55,8 +55,9 @@ weston_platform_get_egl_proc_address(const char *address)
{
const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
if (strstr(extensions, "EGL_EXT_platform_wayland")
|| strstr(extensions, "EGL_KHR_platform_wayland")) {
if (extensions
&& (strstr(extensions, "EGL_EXT_platform_wayland")
|| strstr(extensions, "EGL_KHR_platform_wayland"))) {
return (void *) eglGetProcAddress(address);
}