[metacity] compositor: add MetaCompositorVulkan
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: add MetaCompositorVulkan
- Date: Fri, 10 Mar 2017 20:21:16 +0000 (UTC)
commit 024e8c4265c4a7d6221a85c951abcdc7af3a769e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Mar 9 20:33:29 2017 +0200
compositor: add MetaCompositorVulkan
src/Makefile.am | 2 +
src/compositor/meta-compositor-vulkan.c | 162 +++++++++++++++++++++++++++++++
src/compositor/meta-compositor-vulkan.h | 31 ++++++
src/compositor/meta-compositor.c | 5 +
src/include/meta-compositor.h | 3 +-
5 files changed, 202 insertions(+), 1 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 23e1b6e..77bce29 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,8 @@ metacity_SOURCES= \
compositor/meta-compositor-private.h \
compositor/meta-compositor-xrender.c \
compositor/meta-compositor-xrender.h \
+ compositor/meta-compositor-vulkan.c \
+ compositor/meta-compositor-vulkan.h \
include/meta-compositor.h \
core/above-tab-keycode.c \
core/constraints.c \
diff --git a/src/compositor/meta-compositor-vulkan.c b/src/compositor/meta-compositor-vulkan.c
new file mode 100644
index 0000000..69165b2
--- /dev/null
+++ b/src/compositor/meta-compositor-vulkan.c
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2017 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "meta-compositor-vulkan.h"
+
+struct _MetaCompositorVulkan
+{
+ MetaCompositor parent;
+};
+
+G_DEFINE_TYPE (MetaCompositorVulkan, meta_compositor_vulkan, META_TYPE_COMPOSITOR)
+
+static gboolean
+meta_compositor_vulkan_manage (MetaCompositor *compositor,
+ GError **error)
+{
+#ifdef HAVE_VULKAN
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Not implemented");
+
+ return FALSE;
+#else
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Compiled without Vulkan support");
+
+ return FALSE;
+#endif
+}
+
+static void
+meta_compositor_vulkan_add_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_remove_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_show_window (MetaCompositor *compositor,
+ MetaWindow *window,
+ MetaEffectType effect)
+{
+}
+
+static void
+meta_compositor_vulkan_hide_window (MetaCompositor *compositor,
+ MetaWindow *window,
+ MetaEffectType effect)
+{
+}
+
+static void
+meta_compositor_vulkan_window_opacity_changed (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_window_shape_changed (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_set_updates_frozen (MetaCompositor *compositor,
+ MetaWindow *window,
+ gboolean updates_frozen)
+{
+}
+
+static void
+meta_compositor_vulkan_process_event (MetaCompositor *compositor,
+ XEvent *event,
+ MetaWindow *window)
+{
+}
+
+static cairo_surface_t *
+meta_compositor_vulkan_get_window_surface (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+ return NULL;
+}
+
+static void
+meta_compositor_vulkan_set_active_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_maximize_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_unmaximize_window (MetaCompositor *compositor,
+ MetaWindow *window)
+{
+}
+
+static void
+meta_compositor_vulkan_sync_stack (MetaCompositor *compositor,
+ GList *stack)
+{
+}
+
+static gboolean
+meta_compositor_vulkan_is_our_xwindow (MetaCompositor *compositor,
+ Window xwindow)
+{
+ return FALSE;
+}
+
+static void
+meta_compositor_vulkan_class_init (MetaCompositorVulkanClass *vulkan_class)
+{
+ MetaCompositorClass *compositor_class;
+
+ compositor_class = META_COMPOSITOR_CLASS (vulkan_class);
+
+ compositor_class->manage = meta_compositor_vulkan_manage;
+ compositor_class->add_window = meta_compositor_vulkan_add_window;
+ compositor_class->remove_window = meta_compositor_vulkan_remove_window;
+ compositor_class->show_window = meta_compositor_vulkan_show_window;
+ compositor_class->hide_window = meta_compositor_vulkan_hide_window;
+ compositor_class->window_opacity_changed = meta_compositor_vulkan_window_opacity_changed;
+ compositor_class->window_shape_changed = meta_compositor_vulkan_window_shape_changed;
+ compositor_class->set_updates_frozen = meta_compositor_vulkan_set_updates_frozen;
+ compositor_class->process_event = meta_compositor_vulkan_process_event;
+ compositor_class->get_window_surface = meta_compositor_vulkan_get_window_surface;
+ compositor_class->set_active_window = meta_compositor_vulkan_set_active_window;
+ compositor_class->maximize_window = meta_compositor_vulkan_maximize_window;
+ compositor_class->unmaximize_window = meta_compositor_vulkan_unmaximize_window;
+ compositor_class->sync_stack = meta_compositor_vulkan_sync_stack;
+ compositor_class->is_our_xwindow = meta_compositor_vulkan_is_our_xwindow;
+}
+
+static void
+meta_compositor_vulkan_init (MetaCompositorVulkan *vulkan)
+{
+}
diff --git a/src/compositor/meta-compositor-vulkan.h b/src/compositor/meta-compositor-vulkan.h
new file mode 100644
index 0000000..f5a1c59
--- /dev/null
+++ b/src/compositor/meta-compositor-vulkan.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef META_COMPOSITOR_VULKAN_H
+#define META_COMPOSITOR_VULKAN_H
+
+#include "meta-compositor-private.h"
+
+G_BEGIN_DECLS
+
+#define META_TYPE_COMPOSITOR_VULKAN meta_compositor_vulkan_get_type ()
+G_DECLARE_FINAL_TYPE (MetaCompositorVulkan, meta_compositor_vulkan,
+ META, COMPOSITOR_VULKAN, MetaCompositor)
+
+G_END_DECLS
+
+#endif
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index e6ad7e8..20eb169 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -20,6 +20,7 @@
#include "meta-compositor-none.h"
#include "meta-compositor-xrender.h"
+#include "meta-compositor-vulkan.h"
typedef struct
{
@@ -166,6 +167,10 @@ meta_compositor_new (MetaCompositorType type,
gtype = META_TYPE_COMPOSITOR_XRENDER;
break;
+ case META_COMPOSITOR_TYPE_VULKAN:
+ gtype = META_TYPE_COMPOSITOR_VULKAN;
+ break;
+
default:
g_assert_not_reached ();
break;
diff --git a/src/include/meta-compositor.h b/src/include/meta-compositor.h
index 0469bf0..2e5c08d 100644
--- a/src/include/meta-compositor.h
+++ b/src/include/meta-compositor.h
@@ -34,7 +34,8 @@ G_DECLARE_DERIVABLE_TYPE (MetaCompositor, meta_compositor,
typedef enum
{
META_COMPOSITOR_TYPE_NONE,
- META_COMPOSITOR_TYPE_XRENDER
+ META_COMPOSITOR_TYPE_XRENDER,
+ META_COMPOSITOR_TYPE_VULKAN
} MetaCompositorType;
typedef enum
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]