mirror of
https://github.com/brl/mutter.git
synced 2024-12-22 19:12:04 +00:00
wayland/eglstream: Don't build skeleton when disabled
Instead of calling no-op functions when EGLStream support isn't enabled, make it clear at the call site that EGLStream support is optional.
This commit is contained in:
parent
6192e944b8
commit
417c00b8fa
@ -408,8 +408,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
|
||||
wayland/meta-wayland-data-device.c \
|
||||
wayland/meta-wayland-data-device.h \
|
||||
wayland/meta-wayland-data-device-private.h \
|
||||
wayland/meta-wayland-egl-stream.c \
|
||||
wayland/meta-wayland-egl-stream.h \
|
||||
wayland/meta-wayland-input-device.c \
|
||||
wayland/meta-wayland-input-device.h \
|
||||
wayland/meta-wayland-pointer-gestures.c \
|
||||
@ -491,6 +489,13 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
|
||||
wayland/meta-xwayland-grab-keyboard.c \
|
||||
wayland/meta-xwayland-grab-keyboard.h \
|
||||
$(NULL)
|
||||
|
||||
if HAVE_WAYLAND_EGLSTREAM
|
||||
libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
|
||||
wayland/meta-wayland-egl-stream.c \
|
||||
wayland/meta-wayland-egl-stream.h \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
if HAVE_NATIVE_BACKEND
|
||||
|
@ -108,7 +108,9 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
|
||||
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
|
||||
CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
MetaWaylandEglStream *stream;
|
||||
#endif
|
||||
MetaWaylandDmaBufBuffer *dma_buf;
|
||||
|
||||
if (wl_shm_buffer_get (buffer->resource) != NULL)
|
||||
@ -125,6 +127,7 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
stream = meta_wayland_egl_stream_new (buffer, NULL);
|
||||
if (stream)
|
||||
{
|
||||
@ -141,6 +144,7 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* HAVE_WAYLAND_EGLSTREAM */
|
||||
|
||||
dma_buf = meta_wayland_dma_buf_from_buffer (buffer);
|
||||
if (dma_buf)
|
||||
@ -320,6 +324,7 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
static gboolean
|
||||
egl_stream_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
GError **error)
|
||||
@ -333,6 +338,7 @@ egl_stream_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* HAVE_WAYLAND_EGLSTREAM */
|
||||
|
||||
gboolean
|
||||
meta_wayland_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
@ -355,8 +361,10 @@ meta_wayland_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
return shm_buffer_attach (buffer, error);
|
||||
case META_WAYLAND_BUFFER_TYPE_EGL_IMAGE:
|
||||
return egl_image_buffer_attach (buffer, error);
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
case META_WAYLAND_BUFFER_TYPE_EGL_STREAM:
|
||||
return egl_stream_buffer_attach (buffer, error);
|
||||
#endif
|
||||
case META_WAYLAND_BUFFER_TYPE_DMA_BUF:
|
||||
return meta_wayland_dma_buf_buffer_attach (buffer, error);
|
||||
case META_WAYLAND_BUFFER_TYPE_UNKNOWN:
|
||||
@ -376,10 +384,14 @@ meta_wayland_buffer_get_texture (MetaWaylandBuffer *buffer)
|
||||
CoglSnippet *
|
||||
meta_wayland_buffer_create_snippet (MetaWaylandBuffer *buffer)
|
||||
{
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
if (!buffer->egl_stream.stream)
|
||||
return NULL;
|
||||
|
||||
return meta_wayland_egl_stream_create_snippet ();
|
||||
#else
|
||||
return NULL;
|
||||
#endif /* HAVE_WAYLAND_EGLSTREAM */
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -448,7 +460,9 @@ meta_wayland_buffer_process_damage (MetaWaylandBuffer *buffer,
|
||||
res = process_shm_buffer_damage (buffer, region, &error);
|
||||
break;
|
||||
case META_WAYLAND_BUFFER_TYPE_EGL_IMAGE:
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
case META_WAYLAND_BUFFER_TYPE_EGL_STREAM:
|
||||
#endif
|
||||
case META_WAYLAND_BUFFER_TYPE_DMA_BUF:
|
||||
res = TRUE;
|
||||
break;
|
||||
@ -473,7 +487,9 @@ meta_wayland_buffer_finalize (GObject *object)
|
||||
MetaWaylandBuffer *buffer = META_WAYLAND_BUFFER (object);
|
||||
|
||||
g_clear_pointer (&buffer->texture, cogl_object_unref);
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
g_clear_object (&buffer->egl_stream.stream);
|
||||
#endif
|
||||
g_clear_object (&buffer->dma_buf.dma_buf);
|
||||
|
||||
G_OBJECT_CLASS (meta_wayland_buffer_parent_class)->finalize (object);
|
||||
|
@ -38,7 +38,9 @@ typedef enum _MetaWaylandBufferType
|
||||
META_WAYLAND_BUFFER_TYPE_UNKNOWN,
|
||||
META_WAYLAND_BUFFER_TYPE_SHM,
|
||||
META_WAYLAND_BUFFER_TYPE_EGL_IMAGE,
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
META_WAYLAND_BUFFER_TYPE_EGL_STREAM,
|
||||
#endif
|
||||
META_WAYLAND_BUFFER_TYPE_DMA_BUF,
|
||||
} MetaWaylandBufferType;
|
||||
|
||||
@ -54,9 +56,11 @@ struct _MetaWaylandBuffer
|
||||
|
||||
MetaWaylandBufferType type;
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
struct {
|
||||
MetaWaylandEglStream *stream;
|
||||
} egl_stream;
|
||||
#endif
|
||||
|
||||
struct {
|
||||
MetaWaylandDmaBufBuffer *dma_buf;
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "wayland/meta-wayland-egl-stream.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "backends/meta-egl-ext.h"
|
||||
#include "backends/meta-egl.h"
|
||||
@ -34,10 +36,6 @@
|
||||
#include "wayland/meta-wayland-buffer.h"
|
||||
#include "wayland/meta-wayland-private.h"
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wayland-eglstream-controller-server-protocol.h"
|
||||
|
||||
static struct wl_interface *wl_eglstream_controller_interface_ptr = NULL;
|
||||
@ -86,12 +84,9 @@ bind_eglstream_controller (struct wl_client *client,
|
||||
NULL);
|
||||
}
|
||||
|
||||
#endif /* HAVE_WAYLAND_EGLSTREAM */
|
||||
|
||||
gboolean
|
||||
meta_wayland_eglstream_controller_init (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
/*
|
||||
* wl_eglstream_controller_interface is provided by
|
||||
* libnvidia-egl-wayland.so.1
|
||||
@ -127,7 +122,6 @@ fail:
|
||||
dlclose(lib);
|
||||
|
||||
g_debug ("WL: Unable to initialize wl_eglstream_controller.");
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -398,7 +398,9 @@ meta_wayland_init (void)
|
||||
meta_xwayland_global_filter,
|
||||
compositor);
|
||||
|
||||
#ifdef HAVE_WAYLAND_EGLSTREAM
|
||||
meta_wayland_eglstream_controller_init (compositor);
|
||||
#endif
|
||||
|
||||
if (meta_should_autostart_x11_display ())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user