egl: Only expose clutter_egl_set_kms_fd if we have KMS support

And only call the proper Cogl functions in that case, too. This
fixes the build on platforms without KMS, like the BSDs.

https://bugzilla.gnome.org/show_bug.cgi?id=726198
This commit is contained in:
Jasper St. Pierre 2014-03-14 21:24:57 -04:00 committed by Emmanuele Bassi
parent a4440b718d
commit 79ece182dc
2 changed files with 8 additions and 0 deletions

View File

@ -59,7 +59,9 @@
G_DEFINE_TYPE (ClutterBackendEglNative, clutter_backend_egl_native, CLUTTER_TYPE_BACKEND);
#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
static int _kms_fd = -1;
#endif
static void
clutter_backend_egl_native_dispose (GObject *gobject)
@ -83,11 +85,13 @@ clutter_backend_egl_native_get_renderer (ClutterBackend *backend,
renderer = cogl_renderer_new ();
#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
if (_kms_fd > -1)
{
cogl_renderer_set_winsys_id (renderer, COGL_WINSYS_ID_EGL_KMS);
cogl_kms_renderer_set_kms_fd (renderer, _kms_fd);
}
#endif
return renderer;
}
@ -181,6 +185,7 @@ clutter_egl_get_egl_display (void)
#endif
}
#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
/**
* clutter_egl_set_kms_fd:
* @fd: The fd to talk to the kms driver with
@ -198,3 +203,4 @@ clutter_egl_set_kms_fd (int fd)
{
_kms_fd = fd;
}
#endif

View File

@ -87,7 +87,9 @@ EGLDisplay clutter_egl_display (void);
*/
EGLDisplay clutter_egl_get_egl_display (void);
#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
void clutter_egl_set_kms_fd (int fd);
#endif
G_END_DECLS