diff --git a/.clutter.metadata b/.clutter.metadata index f26b0ed..672236f 100644 --- a/.clutter.metadata +++ b/.clutter.metadata @@ -1 +1 @@ -9939b90268e44c5500f44f3b11665eafabe8193e SOURCES/clutter-1.20.0.tar.xz +f6ebdd5ab5a5d5eca4f3c0db3dfdb8e3ac305b54 SOURCES/clutter-1.26.0.tar.xz diff --git a/.gitignore b/.gitignore index bf2e81a..228943d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/clutter-1.20.0.tar.xz +SOURCES/clutter-1.26.0.tar.xz diff --git a/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch b/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch deleted file mode 100644 index 0534e0e..0000000 --- a/SOURCES/Allow-setting-up-quad-buffer-stereo-output.patch +++ /dev/null @@ -1,247 +0,0 @@ -From d1ee5c340237cb64b18cc4fdef91bc472eb415ef Mon Sep 17 00:00:00 2001 -From: "Owen W. Taylor" -Date: Thu, 8 May 2014 18:52:09 -0400 -Subject: [PATCH] Allow setting up quad-buffer stereo output - -Add clutter_x11_set_use_stereo_stage() that can be called -before clutter_init() so that the CoglDisplay we create and all -stages created from that CoglDisplay will be created with a -stereo fbconfig. - -This is done in clutter-x11 because of the similarity to the -existing clutter_x11_set_use_argb_visual(), and because it's -not clear without other examples whether the need to have -stereo enabled from before clutter_init() is universal or -somethign specific to GLX. - -https://bugzilla.gnome.org/show_bug.cgi?id=732706 ---- - clutter/x11/clutter-backend-x11.c | 168 +++++++++++++++++++++++++++++--------- - clutter/x11/clutter-x11.h | 3 + - 2 files changed, 131 insertions(+), 40 deletions(-) - -diff -up clutter-1.20.0/clutter/x11/clutter-backend-x11.c.quadbuffer-stereo clutter-1.20.0/clutter/x11/clutter-backend-x11.c ---- clutter-1.20.0/clutter/x11/clutter-backend-x11.c.quadbuffer-stereo 2014-09-22 06:01:08.000000000 -0400 -+++ clutter-1.20.0/clutter/x11/clutter-backend-x11.c 2016-02-02 15:09:15.962579511 -0500 -@@ -93,6 +93,7 @@ static const gchar *atom_names[] = { - static gboolean _no_xevent_retrieval = FALSE; - static gboolean clutter_enable_xinput = TRUE; - static gboolean clutter_enable_argb = FALSE; -+static gboolean clutter_enable_stereo = FALSE; - static Display *_foreign_dpy = NULL; - - /* options */ -@@ -688,6 +689,59 @@ clutter_backend_x11_get_renderer (Clutte - return renderer; - } - -+static gboolean -+check_onscreen_template (CoglRenderer *renderer, -+ CoglSwapChain *swap_chain, -+ CoglOnscreenTemplate *onscreen_template, -+ CoglBool enable_argb, -+ CoglBool enable_stereo, -+ GError **error) -+{ -+ GError *internal_error = NULL; -+ -+ cogl_swap_chain_set_has_alpha (swap_chain, enable_argb); -+ cogl_onscreen_template_set_stereo_enabled (onscreen_template, -+ clutter_enable_stereo); -+ -+ /* cogl_renderer_check_onscreen_template() is actually just a -+ * shorthand for creating a CoglDisplay, and calling -+ * cogl_display_setup() on it, then throwing the display away. If we -+ * could just return that display, then it would be more efficient -+ * not to use cogl_renderer_check_onscreen_template(). However, the -+ * backend API requires that we return an CoglDisplay that has not -+ * yet been setup, so one way or the other we'll have to discard the -+ * first display and make a new fresh one. -+ */ -+ if (cogl_renderer_check_onscreen_template (renderer, onscreen_template, &internal_error)) -+ { -+ clutter_enable_argb = enable_argb; -+ clutter_enable_stereo = enable_stereo; -+ -+ return TRUE; -+ } -+ else -+ { -+ if (enable_argb || enable_stereo) /* More possibilities to try */ -+ CLUTTER_NOTE (BACKEND, -+ "Creation of a CoglDisplay with alpha=%s, stereo=%s failed: %s", -+ enable_argb ? "enabled" : "disabled", -+ enable_stereo ? "enabled" : "disabled", -+ internal_error != NULL -+ ? internal_error->message -+ : "Unknown reason"); -+ else -+ g_set_error_literal (error, CLUTTER_INIT_ERROR, -+ CLUTTER_INIT_ERROR_BACKEND, -+ internal_error != NULL -+ ? internal_error->message -+ : "Creation of a CoglDisplay failed"); -+ -+ g_clear_error (&internal_error); -+ -+ return FALSE; -+ } -+} -+ - static CoglDisplay * - clutter_backend_x11_get_display (ClutterBackend *backend, - CoglRenderer *renderer, -@@ -695,56 +749,38 @@ clutter_backend_x11_get_display (Clutter - GError **error) - { - CoglOnscreenTemplate *onscreen_template; -- GError *internal_error = NULL; -- CoglDisplay *display; -- gboolean res; -+ CoglDisplay *display = NULL; -+ gboolean res = FALSE; - -- CLUTTER_NOTE (BACKEND, "Alpha on Cogl swap chain: %s", -- clutter_enable_argb ? "enabled" : "disabled"); -- -- cogl_swap_chain_set_has_alpha (swap_chain, clutter_enable_argb); -+ CLUTTER_NOTE (BACKEND, "Creating CoglDisplay, alpha=%s, stereo=%s", -+ clutter_enable_argb ? "enabled" : "disabled", -+ clutter_enable_stereo ? "enabled" : "disabled"); - - onscreen_template = cogl_onscreen_template_new (swap_chain); - -- res = cogl_renderer_check_onscreen_template (renderer, -- onscreen_template, -- &internal_error); -- if (!res && clutter_enable_argb) -- { -- CLUTTER_NOTE (BACKEND, -- "Creation of a context with a ARGB visual failed: %s", -- internal_error != NULL ? internal_error->message -- : "Unknown reason"); -- -- g_clear_error (&internal_error); -+ /* It's possible that the current renderer doesn't support transparency -+ * or doesn't support stereo, so we try the different combinations. -+ */ -+ if (clutter_enable_argb && clutter_enable_stereo) -+ res = check_onscreen_template (renderer, swap_chain, onscreen_template, -+ TRUE, TRUE, error); -+ -+ /* Prioritize stereo over alpha */ -+ if (!res && clutter_enable_stereo) -+ res = check_onscreen_template (renderer, swap_chain, onscreen_template, -+ FALSE, TRUE, error); - -- /* It's possible that the current renderer doesn't support transparency -- * in a swap_chain so lets see if we can fallback to not having any -- * transparency... -- * -- * XXX: It might be nice to have a CoglRenderer feature we could -- * explicitly check for ahead of time. -- */ -- clutter_enable_argb = FALSE; -- cogl_swap_chain_set_has_alpha (swap_chain, FALSE); -- res = cogl_renderer_check_onscreen_template (renderer, -- onscreen_template, -- &internal_error); -- } -+ if (!res && clutter_enable_argb) -+ res = check_onscreen_template (renderer, swap_chain, onscreen_template, -+ TRUE, FALSE, error); - - if (!res) -- { -- g_set_error_literal (error, CLUTTER_INIT_ERROR, -- CLUTTER_INIT_ERROR_BACKEND, -- internal_error->message); -+ res = check_onscreen_template (renderer, swap_chain, onscreen_template, -+ FALSE, FALSE, error); - -- g_error_free (internal_error); -- cogl_object_unref (onscreen_template); -- -- return NULL; -- } -+ if (res) -+ display = cogl_display_new (renderer, onscreen_template); - -- display = cogl_display_new (renderer, onscreen_template); - cogl_object_unref (onscreen_template); - - return display; -@@ -1303,6 +1339,58 @@ clutter_x11_get_use_argb_visual (void) - return clutter_enable_argb; - } - -+/** -+ * clutter_x11_set_use_stereo_stage: -+ * @use_stereo: %TRUE if the stereo stages should be used if possible. -+ * -+ * Sets whether the backend object for Clutter stages, will, -+ * if possible, be created with the ability to support stereo drawing -+ * (drawing separate images for the left and right eyes). -+ * -+ * This function must be called before clutter_init() is called. -+ * During paint callbacks, cogl_framebuffer_is_stereo() can be called -+ * on the framebuffer retrieved by cogl_get_draw_framebuffer() to -+ * determine if stereo support was successfully enabled, and -+ * cogl_framebuffer_set_stereo_mode() to determine which buffers -+ * will be drawn to. -+ * -+ * Note that this function *does not* cause the stage to be drawn -+ * multiple times with different perspective transformations and thus -+ * appear in 3D, it simply enables individual ClutterActors to paint -+ * different images for the left and and right eye. -+ * -+ */ -+void -+clutter_x11_set_use_stereo_stage (gboolean use_stereo) -+{ -+ if (_clutter_context_is_initialized ()) -+ { -+ g_warning ("%s() can only be used before calling clutter_init()", -+ G_STRFUNC); -+ return; -+ } -+ -+ CLUTTER_NOTE (BACKEND, "STEREO stages are %s", -+ use_stereo ? "enabled" : "disabled"); -+ -+ clutter_enable_stereo = use_stereo; -+} -+ -+/** -+ * clutter_x11_get_use_stereo_stage: -+ * -+ * Retrieves whether the Clutter X11 backend will create stereo -+ * stages if possible. -+ * -+ * Return value: %TRUE if stereo stages are used if possible -+ * -+ */ -+gboolean -+clutter_x11_get_use_stereo_stage (void) -+{ -+ return clutter_enable_stereo; -+} -+ - XVisualInfo * - _clutter_backend_x11_get_visual_info (ClutterBackendX11 *backend_x11) - { -diff -up clutter-1.20.0/clutter/x11/clutter-x11.h.quadbuffer-stereo clutter-1.20.0/clutter/x11/clutter-x11.h ---- clutter-1.20.0/clutter/x11/clutter-x11.h.quadbuffer-stereo 2014-09-22 06:01:08.000000000 -0400 -+++ clutter-1.20.0/clutter/x11/clutter-x11.h 2016-02-02 15:09:59.630275599 -0500 -@@ -157,6 +157,11 @@ CLUTTER_AVAILABLE_IN_ALL - gboolean clutter_x11_get_use_argb_visual (void); - - CLUTTER_AVAILABLE_IN_ALL -+void clutter_x11_set_use_stereo_stage (gboolean use_stereo); -+CLUTTER_AVAILABLE_IN_ALL -+gboolean clutter_x11_get_use_stereo_stage (void); -+ -+CLUTTER_AVAILABLE_IN_ALL - Time clutter_x11_get_current_event_time (void); - - CLUTTER_AVAILABLE_IN_ALL diff --git a/SOURCES/Enable-threaded-swap-wait.patch b/SOURCES/Enable-threaded-swap-wait.patch deleted file mode 100644 index 9e53402..0000000 --- a/SOURCES/Enable-threaded-swap-wait.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -up clutter-1.20.0/clutter/x11/clutter-backend-x11.c.enable-threaded-swap-wait clutter-1.20.0/clutter/x11/clutter-backend-x11.c ---- clutter-1.20.0/clutter/x11/clutter-backend-x11.c.enable-threaded-swap-wait 2016-06-29 15:46:54.250758214 -0400 -+++ clutter-1.20.0/clutter/x11/clutter-backend-x11.c 2016-06-29 15:47:58.573790526 -0400 -@@ -91,6 +91,7 @@ static const gchar *atom_names[] = { - - /* various flags corresponding to pre init setup calls */ - static gboolean _want_reset_on_video_memory_purge = FALSE; -+static gboolean _enable_threaded_swap_wait = FALSE; - static gboolean _no_xevent_retrieval = FALSE; - static gboolean clutter_enable_xinput = TRUE; - static gboolean clutter_enable_argb = FALSE; -@@ -688,6 +689,9 @@ clutter_backend_x11_get_renderer (Clutte - cogl_xlib_renderer_set_foreign_display (renderer, xdisplay); - cogl_xlib_renderer_request_reset_on_video_memory_purge (renderer, - _want_reset_on_video_memory_purge); -+ cogl_xlib_renderer_set_threaded_swap_wait_enabled (renderer, -+ _enable_threaded_swap_wait); -+ - return renderer; - } - -@@ -1054,6 +1058,30 @@ clutter_x11_request_reset_on_video_memor - } - - /** -+ * clutter_x11_enable_threaded_swap_wait: -+ * -+ * If the driver doesn't have a better way to wait for frame completion, -+ * and is on a whitelist of drivers where using a separate thread for -+ * frame completion is known to work, do that. XInitThreads() must be -+ * called by the application before any other Xlib calls. See docs for -+ * cogl_xlib_renderer_set_threaded_swap_wait_enabled() for more details. -+ * -+ * This function can only be called before calling clutter_init(). -+ */ -+void -+clutter_x11_enable_threaded_swap_wait (void) -+{ -+ if (_clutter_context_is_initialized ()) -+ { -+ g_warning ("%s() can only be used before calling clutter_init()", -+ G_STRFUNC); -+ return; -+ } -+ -+ _enable_threaded_swap_wait = TRUE; -+} -+ -+/** - * clutter_x11_get_default_screen: - * - * Gets the number of the default X Screen object. -diff -up clutter-1.20.0/clutter/x11/clutter-x11.h.enable-threaded-swap-wait clutter-1.20.0/clutter/x11/clutter-x11.h ---- clutter-1.20.0/clutter/x11/clutter-x11.h.enable-threaded-swap-wait 2016-06-29 15:46:54.252758246 -0400 -+++ clutter-1.20.0/clutter/x11/clutter-x11.h 2016-06-29 15:47:27.193287248 -0400 -@@ -173,6 +173,9 @@ guint clutter_x11_event_sequence_get_tou - CLUTTER_AVAILABLE_IN_ALL - void clutter_x11_request_reset_on_video_memory_purge (void); - -+CLUTTER_AVAILABLE_IN_ALL -+void clutter_x11_enable_threaded_swap_wait (void); -+ - G_END_DECLS - - #endif /* __CLUTTER_X11_H__ */ diff --git a/SOURCES/add-driver-selection-api.patch b/SOURCES/add-driver-selection-api.patch deleted file mode 100644 index a9ec5e8..0000000 --- a/SOURCES/add-driver-selection-api.patch +++ /dev/null @@ -1,591 +0,0 @@ -From 5c8f7cc3af63cc98a05efec47649f6ab74ca17a0 Mon Sep 17 00:00:00 2001 -From: Adel Gadllah -Date: Sun, 26 Jul 2015 11:29:10 +0200 -Subject: [PATCH 1/7] backend: Check for a known set of drivers - -We want to use the Cogl GL3 driver, if possible, and then go through a -known list of Cogl drivers, before giving up and using COGL_DRIVER_ANY. - -Based on original patch from Emmanuele Bassi. - -We have to create and tear down the whole context when trying -out the drivers though because the extension checks do not happen -until cogl_context_init. - -https://bugzilla.gnome.org/show_bug.cgi?id=742678 ---- - clutter/clutter-backend.c | 69 ++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 56 insertions(+), 13 deletions(-) - -diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c -index d255eee..0a4ae1a 100644 ---- a/clutter/clutter-backend.c -+++ b/clutter/clutter-backend.c -@@ -257,8 +257,9 @@ clutter_backend_real_font_changed (ClutterBackend *backend) - } - - static gboolean --clutter_backend_real_create_context (ClutterBackend *backend, -- GError **error) -+clutter_backend_do_real_create_context (ClutterBackend *backend, -+ CoglDriver driver_id, -+ GError **error) - { - ClutterBackendClass *klass; - CoglSwapChain *swap_chain; -@@ -290,6 +291,7 @@ clutter_backend_real_create_context (ClutterBackend *backend, - #endif - - CLUTTER_NOTE (BACKEND, "Connecting the renderer"); -+ cogl_renderer_set_driver (backend->cogl_renderer, driver_id); - if (!cogl_renderer_connect (backend->cogl_renderer, &internal_error)) - goto error; - -@@ -346,10 +348,6 @@ clutter_backend_real_create_context (ClutterBackend *backend, - if (backend->cogl_context == NULL) - goto error; - -- backend->cogl_source = cogl_glib_source_new (backend->cogl_context, -- G_PRIORITY_DEFAULT); -- g_source_attach (backend->cogl_source, NULL); -- - /* the display owns the renderer and the swap chain */ - cogl_object_unref (backend->cogl_renderer); - cogl_object_unref (swap_chain); -@@ -372,16 +370,61 @@ error: - if (swap_chain != NULL) - cogl_object_unref (swap_chain); - -- if (internal_error != NULL) -- g_propagate_error (error, internal_error); -- else -- g_set_error_literal (error, CLUTTER_INIT_ERROR, -- CLUTTER_INIT_ERROR_BACKEND, -- _("Unable to initialize the Clutter backend")); -- - return FALSE; - } - -+static gboolean -+clutter_backend_real_create_context (ClutterBackend *backend, -+ GError **error) -+{ -+ static const struct { -+ const char *driver_name; -+ CoglDriver driver_id; -+ } known_drivers[] = { -+ { "GL3", COGL_DRIVER_GL3 }, -+ { "GL (Legacy)", COGL_DRIVER_GL }, -+ { "GLES 2.0", COGL_DRIVER_GLES2 }, -+ { "ANY", COGL_DRIVER_ANY }, -+ }; -+ -+ GError *internal_error = NULL; -+ int i; -+ -+ for (i = 0; i < G_N_ELEMENTS (known_drivers); i++) -+ { -+ CLUTTER_NOTE (BACKEND, "Checking for the %s driver", known_drivers[i].driver_name); -+ -+ if (clutter_backend_do_real_create_context (backend, known_drivers[i].driver_id, &internal_error)) -+ break; -+ -+ if (internal_error) -+ { -+ CLUTTER_NOTE (BACKEND, "Unable to use the %s driver: %s", -+ known_drivers[i].driver_name, -+ internal_error->message); -+ g_clear_error (&internal_error); -+ } -+ } -+ -+ if (backend->cogl_context == NULL) -+ { -+ if (internal_error != NULL) -+ g_propagate_error (error, internal_error); -+ else -+ g_set_error_literal (error, CLUTTER_INIT_ERROR, -+ CLUTTER_INIT_ERROR_BACKEND, -+ _("Unable to initialize the Clutter backend")); -+ -+ return FALSE; -+ } -+ -+ backend->cogl_source = cogl_glib_source_new (backend->cogl_context, -+ G_PRIORITY_DEFAULT); -+ g_source_attach (backend->cogl_source, NULL); -+ -+ return TRUE; -+} -+ - static void - clutter_backend_real_ensure_context (ClutterBackend *backend, - ClutterStage *stage) --- -2.7.4 - - -From 6b9281ac7da725a1861a6418c24fcb6371d3c72b Mon Sep 17 00:00:00 2001 -From: Emmanuele Bassi -Date: Wed, 9 Dec 2015 12:45:12 +0000 -Subject: [PATCH 2/7] backend: Allow overriding the Cogl drivers chain - -We have an hardcoded list of drivers we have to go through when creating -a Cogl context. Some platforms may expose those drivers, but not be the -preferred ones. - -In order to allow users and system integrators to override the list of -drivers, we should crib the same approach used by GDK, and have an -environment variable with a list of drivers to try. - -The new environment variable is called `CLUTTER_DRIVER` and accepts a -comma-separated list of driver names, which will be tested in sequence -until one succeeds. There's also an additional '*' token which is used -to ask Clutter to fall back to the internally defined preferred list of -drivers. - -https://bugzilla.gnome.org/show_bug.cgi?id=742678 ---- - clutter/clutter-backend.c | 79 ++++++++++++++++++++++--------- - doc/reference/clutter/running-clutter.xml | 55 +++++++++++++++++++++ - 2 files changed, 111 insertions(+), 23 deletions(-) - -diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c -index 0a4ae1a..9ee3659 100644 ---- a/clutter/clutter-backend.c -+++ b/clutter/clutter-backend.c -@@ -373,39 +373,73 @@ error: - return FALSE; - } - -+static const struct { -+ const char *driver_name; -+ const char *driver_desc; -+ CoglDriver driver_id; -+} all_known_drivers[] = { -+ { "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 }, -+ { "gl", "OpenGL legacy profile", COGL_DRIVER_GL }, -+ { "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 }, -+ { "any", "Default Cogl driver", COGL_DRIVER_ANY }, -+}; -+ -+static char *allowed_drivers; -+ - static gboolean - clutter_backend_real_create_context (ClutterBackend *backend, - GError **error) - { -- static const struct { -- const char *driver_name; -- CoglDriver driver_id; -- } known_drivers[] = { -- { "GL3", COGL_DRIVER_GL3 }, -- { "GL (Legacy)", COGL_DRIVER_GL }, -- { "GLES 2.0", COGL_DRIVER_GLES2 }, -- { "ANY", COGL_DRIVER_ANY }, -- }; -- - GError *internal_error = NULL; -+ const char *drivers_list; -+ char **known_drivers; -+ gboolean allow_any; - int i; - -- for (i = 0; i < G_N_ELEMENTS (known_drivers); i++) -- { -- CLUTTER_NOTE (BACKEND, "Checking for the %s driver", known_drivers[i].driver_name); -+ if (allowed_drivers == NULL) -+ allowed_drivers = "*"; -+ -+ allow_any = strstr (allowed_drivers, "*") != NULL; -+ -+ drivers_list = g_getenv ("CLUTTER_DRIVER"); -+ if (drivers_list == NULL) -+ drivers_list = allowed_drivers; - -- if (clutter_backend_do_real_create_context (backend, known_drivers[i].driver_id, &internal_error)) -- break; -+ known_drivers = g_strsplit (drivers_list, ",", 0); - -- if (internal_error) -+ for (i = 0; backend->cogl_context == NULL && known_drivers[i] != NULL; i++) -+ { -+ const char *driver_name = known_drivers[i]; -+ gboolean is_any = g_str_equal (driver_name, "*"); -+ int j; -+ -+ for (j = 0; j < G_N_ELEMENTS (all_known_drivers); j++) - { -- CLUTTER_NOTE (BACKEND, "Unable to use the %s driver: %s", -- known_drivers[i].driver_name, -- internal_error->message); -- g_clear_error (&internal_error); -+ if (!allow_any && !is_any && !strstr (driver_name, all_known_drivers[j].driver_name)) -+ continue; -+ -+ if ((allow_any && is_any) || -+ (is_any && strstr (allowed_drivers, all_known_drivers[j].driver_name)) || -+ g_str_equal (all_known_drivers[j].driver_name, driver_name)) -+ { -+ CLUTTER_NOTE (BACKEND, "Checking for the %s driver", all_known_drivers[j].driver_desc); -+ -+ if (clutter_backend_do_real_create_context (backend, all_known_drivers[j].driver_id, &internal_error)) -+ break; -+ -+ if (internal_error) -+ { -+ CLUTTER_NOTE (BACKEND, "Unable to use the %s driver: %s", -+ all_known_drivers[j].driver_desc, -+ internal_error->message); -+ g_clear_error (&internal_error); -+ } -+ } - } - } - -+ g_strfreev (known_drivers); -+ - if (backend->cogl_context == NULL) - { - if (internal_error != NULL) -@@ -413,13 +447,12 @@ clutter_backend_real_create_context (ClutterBackend *backend, - else - g_set_error_literal (error, CLUTTER_INIT_ERROR, - CLUTTER_INIT_ERROR_BACKEND, -- _("Unable to initialize the Clutter backend")); -+ _("Unable to initialize the Clutter backend: no available drivers found.")); - - return FALSE; - } - -- backend->cogl_source = cogl_glib_source_new (backend->cogl_context, -- G_PRIORITY_DEFAULT); -+ backend->cogl_source = cogl_glib_source_new (backend->cogl_context, G_PRIORITY_DEFAULT); - g_source_attach (backend->cogl_source, NULL); - - return TRUE; -diff --git a/doc/reference/clutter/running-clutter.xml b/doc/reference/clutter/running-clutter.xml -index 9d1dc63..2d782b3 100644 ---- a/doc/reference/clutter/running-clutter.xml -+++ b/doc/reference/clutter/running-clutter.xml -@@ -27,6 +27,61 @@ - - - -+ CLUTTER_BACKEND -+ -+ Changes the windowing system backend used by Clutter. -+ The allowed values for this environment variable depend on -+ the configuration options used when compiling Clutter. The -+ available values are: -+ -+ x11, for the X11 backend -+ wayland, for the Wayland backend -+ win32, for the Windows backend -+ osx, for the MacOS X backend -+ gsk, for the GDK backend -+ eglnative, for the EGL/KMS backend -+ cex100, for the CEx100 backend -+ -+ All of the above options except for the eglnative -+ and cex100 backends also have an input backend. -+ -+ -+ -+ CLUTTER_INPUT_BACKEND -+ -+ Changes the input backend used by Clutter. -+ The allowed values for this environment variable depend on -+ the configuration options used when compiling Clutter. The -+ available values are: -+ -+ tslib -+ evdev -+ null -+ -+ This environment variable is only useful for setting the input -+ backend when using a windowing system backend that does not have an -+ input API, like the eglnative or the cex100 -+ windowing system backends. -+ -+ -+ -+ CLUTTER_DRIVER -+ -+ Changes the GL driver used when initializing Clutter. -+ The allowed values for this environment variable are: -+ -+ gl3, for the GL driver using a 3.2+ core profile -+ gl, for the GL driver using a legacy profile -+ gles2, for the GLES 2.0 driver -+ any, for the default chosen by Cogl -+ -+ The special '*' value can be used to ask Clutter to use the -+ default list of drivers, e.g. 'CLUTTER_DRIVER=gles2,*' will ask Clutter -+ to try the GLES 2.0 driver first, and then fall back to the default list -+ of Cogl drivers. -+ -+ -+ - CLUTTER_SCALE - - Forces the window scaling factor to that value --- -2.7.4 - - -From e012c6823f2619d7ce85fb14a773c84b22a5b9fe Mon Sep 17 00:00:00 2001 -From: Emmanuele Bassi -Date: Wed, 9 Dec 2015 14:26:28 +0000 -Subject: [PATCH 3/7] Add a configuration option for deciding the Cogl drivers - to use - -Using environment variables only is not convenient for all platforms, -and in some cases it's beneficial to decide the default driver when -building Clutter. Cogl already has a similar configuration switch, and -since Clutter is overriding the default Cogl behaviour, it should offer -the same mechanism. - -https://bugzilla.gnome.org/show_bug.cgi?id=742678 ---- - clutter/clutter-backend.c | 2 +- - configure.ac | 9 +++++++++ - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c -index 9ee3659..3faae3a 100644 ---- a/clutter/clutter-backend.c -+++ b/clutter/clutter-backend.c -@@ -397,7 +397,7 @@ clutter_backend_real_create_context (ClutterBackend *backend, - int i; - - if (allowed_drivers == NULL) -- allowed_drivers = "*"; -+ allowed_drivers = CLUTTER_DRIVERS; - - allow_any = strstr (allowed_drivers, "*") != NULL; - -diff --git a/configure.ac b/configure.ac -index 0a62633..fe7e085 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -534,6 +534,13 @@ dnl other tools such as glib-mkenums and gir-scanner don't end up - dnl using the define also. - AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally]) - -+AC_ARG_WITH([default-drivers], -+ [AS_HELP_STRING([--with-default-drivers=DRIVER], [Comma-separated list of Cogl drivers to use])], -+ [clutter_drivers=$withval], -+ [clutter_drivers="*"]) -+ -+AC_DEFINE_UNQUOTED([CLUTTER_DRIVERS], ["$clutter_drivers"], [List of Cogl drivers]) -+ - dnl strip leading spaces - CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* } - AC_SUBST(CLUTTER_BACKENDS) -@@ -1274,6 +1281,8 @@ else - echo " Input backends: ${CLUTTER_INPUT_BACKENDS} (WARNING: Experimental backends enabled)" - fi - -+echo " Cogl drivers: $clutter_drivers" -+ - if test "x$SUPPORT_X11" = "x1"; then - echo "" - echo " - X11 backend options:" --- -2.7.4 - - -From 486a1a8a0ddc40c7782c0b0508768b3d8baa12db Mon Sep 17 00:00:00 2001 -From: Emmanuele Bassi -Date: Thu, 10 Dec 2015 16:52:45 +0000 -Subject: [PATCH 4/7] Allow overriding the list of Cogl drivers via - configuration file - -Clutter has a configuration file that can be used to override -various settings, including the ones from environment variables. ---- - clutter/clutter-backend-private.h | 2 ++ - clutter/clutter-backend.c | 8 +++++++- - clutter/clutter-main.c | 11 +++++++++++ - 3 files changed, 20 insertions(+), 1 deletion(-) - -diff --git a/clutter/clutter-backend-private.h b/clutter/clutter-backend-private.h -index a9e7ae2..801548b 100644 ---- a/clutter/clutter-backend-private.h -+++ b/clutter/clutter-backend-private.h -@@ -142,6 +142,8 @@ gint32 _clutter_backend_get_units_serial (Clutter - - PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend); - -+void clutter_set_allowed_drivers (const char *drivers); -+ - G_END_DECLS - - #endif /* __CLUTTER_BACKEND_PRIVATE_H__ */ -diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c -index 3faae3a..34c088d 100644 ---- a/clutter/clutter-backend.c -+++ b/clutter/clutter-backend.c -@@ -384,7 +384,7 @@ static const struct { - { "any", "Default Cogl driver", COGL_DRIVER_ANY }, - }; - --static char *allowed_drivers; -+static const char *allowed_drivers; - - static gboolean - clutter_backend_real_create_context (ClutterBackend *backend, -@@ -1492,3 +1492,9 @@ _clutter_backend_get_keymap_direction (ClutterBackend *backend) - - return PANGO_DIRECTION_NEUTRAL; - } -+ -+void -+clutter_set_allowed_drivers (const char *drivers) -+{ -+ allowed_drivers = g_strdup (drivers); -+} -diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c -index 444ceba..11d5150 100644 ---- a/clutter/clutter-main.c -+++ b/clutter/clutter-main.c -@@ -229,6 +229,17 @@ clutter_config_read_from_key_file (GKeyFile *keyfile) - if (!g_key_file_has_group (keyfile, ENVIRONMENT_GROUP)) - return; - -+ str_value = -+ g_key_file_get_string (keyfile, ENVIRONMENT_GROUP, -+ "Drivers", -+ &key_error); -+ if (key_error != NULL) -+ g_clear_error (&key_error); -+ else -+ clutter_set_allowed_drivers (str_value); -+ -+ g_free (str_value); -+ - bool_value = - g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP, - "ShowFps", --- -2.7.4 - - -From f09847882c87b94225d14c058a34bb7faedacd09 Mon Sep 17 00:00:00 2001 -From: Rui Matos -Date: Thu, 11 Aug 2016 15:35:59 +0200 -Subject: [PATCH 5/7] Make clutter_set_allowed_drivers() public - -We'll need to call it from mutter. ---- - clutter/clutter-backend-private.h | 2 -- - clutter/clutter-backend.h | 3 +++ - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/clutter/clutter-backend-private.h b/clutter/clutter-backend-private.h -index 801548b..a9e7ae2 100644 ---- a/clutter/clutter-backend-private.h -+++ b/clutter/clutter-backend-private.h -@@ -142,8 +142,6 @@ gint32 _clutter_backend_get_units_serial (Clutter - - PangoDirection _clutter_backend_get_keymap_direction (ClutterBackend *backend); - --void clutter_set_allowed_drivers (const char *drivers); -- - G_END_DECLS - - #endif /* __CLUTTER_BACKEND_PRIVATE_H__ */ -diff --git a/clutter/clutter-backend.h b/clutter/clutter-backend.h -index e14d5d2..c7dfc24 100644 ---- a/clutter/clutter-backend.h -+++ b/clutter/clutter-backend.h -@@ -78,6 +78,9 @@ CLUTTER_AVAILABLE_IN_1_8 - CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend); - #endif - -+CLUTTER_AVAILABLE_IN_ALL -+void clutter_set_allowed_drivers (const char *drivers); -+ - G_END_DECLS - - #endif /* __CLUTTER_BACKEND_H__ */ --- -2.7.4 - - -From aa79960d2e79141f0caaa27a48468ed67acd30b2 Mon Sep 17 00:00:00 2001 -From: Rui Matos -Date: Thu, 11 Aug 2016 15:50:30 +0200 -Subject: [PATCH 6/7] backend: Revert to using the gl driver by default instead - of gl3 - -Some applications (e.g. totem) don't work well (or at all) with the -gl3 driver without modifications and it's safer to keep clutter -behaving the same as it did when RHEL 7 launched so let's switch the -default driver back to gl. ---- - clutter/clutter-backend.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c -index 34c088d..15a1d05 100644 ---- a/clutter/clutter-backend.c -+++ b/clutter/clutter-backend.c -@@ -378,8 +378,8 @@ static const struct { - const char *driver_desc; - CoglDriver driver_id; - } all_known_drivers[] = { -- { "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 }, - { "gl", "OpenGL legacy profile", COGL_DRIVER_GL }, -+ { "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 }, - { "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 }, - { "any", "Default Cogl driver", COGL_DRIVER_ANY }, - }; --- -2.7.4 - - -From 03db9fc0b5035c1c74132b6f33468e8670802558 Mon Sep 17 00:00:00 2001 -From: "Owen W. Taylor" -Date: Wed, 29 Jun 2016 17:03:46 -0400 -Subject: [PATCH 7/7] Don't create the Cogl GLib source multiple times - -Since the check for backend->cogl_context was accidentally moved -to clutter_backend_do_real_create_context, the Glib source that -is created at the end of clutter_backend_do_create_context() is -created and added each time create_context() is called, though -create_context() is supposed to be idempotent. - -https://bugzilla.gnome.org/show_bug.cgi?id=768243 ---- - clutter/clutter-backend.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c -index 15a1d05..56f2bf2 100644 ---- a/clutter/clutter-backend.c -+++ b/clutter/clutter-backend.c -@@ -265,9 +265,6 @@ clutter_backend_do_real_create_context (ClutterBackend *backend, - CoglSwapChain *swap_chain; - GError *internal_error; - -- if (backend->cogl_context != NULL) -- return TRUE; -- - klass = CLUTTER_BACKEND_GET_CLASS (backend); - - swap_chain = NULL; -@@ -396,6 +393,9 @@ clutter_backend_real_create_context (ClutterBackend *backend, - gboolean allow_any; - int i; - -+ if (backend->cogl_context != NULL) -+ return TRUE; -+ - if (allowed_drivers == NULL) - allowed_drivers = CLUTTER_DRIVERS; - --- -2.7.4 - diff --git a/SOURCES/video-memory-purge.patch b/SOURCES/video-memory-purge.patch deleted file mode 100644 index 95e3483..0000000 --- a/SOURCES/video-memory-purge.patch +++ /dev/null @@ -1,81 +0,0 @@ -From a01f454edf05c1204ea4be23fd79576fa7c5b5ff Mon Sep 17 00:00:00 2001 -From: Rui Matos -Date: Tue, 21 Jun 2016 17:40:15 +0200 -Subject: [PATCH] clutter/x11: Add API to request video memory purges to be - reported - ---- - clutter/x11/clutter-backend-x11.c | 28 +++++++++++++++++++++++++++- - clutter/x11/clutter-x11.h | 3 +++ - 2 files changed, 30 insertions(+), 1 deletion(-) - -diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c -index 14eda35..eb0d643 100644 ---- a/clutter/x11/clutter-backend-x11.c -+++ b/clutter/x11/clutter-backend-x11.c -@@ -90,6 +90,7 @@ static const gchar *atom_names[] = { - #define N_ATOM_NAMES G_N_ELEMENTS (atom_names) - - /* various flags corresponding to pre init setup calls */ -+static gboolean _want_reset_on_video_memory_purge = FALSE; - static gboolean _no_xevent_retrieval = FALSE; - static gboolean clutter_enable_xinput = TRUE; - static gboolean clutter_enable_argb = FALSE; -@@ -685,7 +686,8 @@ clutter_backend_x11_get_renderer (ClutterBackend *backend, - - /* set the display object we're using */ - cogl_xlib_renderer_set_foreign_display (renderer, xdisplay); -- -+ cogl_xlib_renderer_request_reset_on_video_memory_purge (renderer, -+ _want_reset_on_video_memory_purge); - return renderer; - } - -@@ -1028,6 +1030,30 @@ clutter_x11_has_event_retrieval (void) - } - - /** -+ * clutter_x11_request_reset_on_video_memory_purge: -+ * -+ * If the GL driver supports the NV_robustness_video_memory_purge -+ * extension, this call lets applications request that it gets -+ * initialized, thus allowing cogl_get_graphics_reset_status() to -+ * report memory purged errors if they happen. Checking for the -+ * graphics reset status is the application's responsibility. -+ * -+ * This function can only be called before calling clutter_init(). -+ */ -+void -+clutter_x11_request_reset_on_video_memory_purge (void) -+{ -+ if (_clutter_context_is_initialized ()) -+ { -+ g_warning ("%s() can only be used before calling clutter_init()", -+ G_STRFUNC); -+ return; -+ } -+ -+ _want_reset_on_video_memory_purge = TRUE; -+} -+ -+/** - * clutter_x11_get_default_screen: - * - * Gets the number of the default X Screen object. -diff --git a/clutter/x11/clutter-x11.h b/clutter/x11/clutter-x11.h -index 4fb2b35..817cd85 100644 ---- a/clutter/x11/clutter-x11.h -+++ b/clutter/x11/clutter-x11.h -@@ -168,6 +168,9 @@ gint clutter_x11_event_get_key_group (const ClutterEvent *event); - CLUTTER_AVAILABLE_IN_ALL - guint clutter_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence); - -+CLUTTER_AVAILABLE_IN_ALL -+void clutter_x11_request_reset_on_video_memory_purge (void); -+ - G_END_DECLS - - #endif /* __CLUTTER_X11_H__ */ --- -2.7.4 - diff --git a/SPECS/clutter.spec b/SPECS/clutter.spec index 076b6f6..27b800a 100644 --- a/SPECS/clutter.spec +++ b/SPECS/clutter.spec @@ -6,43 +6,53 @@ %global with_tests 1 +%global glib2_version 2.44.0 +%global cogl_version 1.21.2 +%global json_glib_version 0.12.0 +%global cairo_version 1.14.0 +%global libinput_version 0.19.0 + Name: clutter -Version: 1.20.0 -Release: 10%{?dist} +Version: 1.26.0 +Release: 1%{?dist} Summary: Open Source software library for creating rich graphical user interfaces Group: Development/Libraries License: LGPLv2+ URL: http://www.clutter-project.org/ -Source0: http://download.gnome.org/sources/clutter/1.20/clutter-%{version}.tar.xz -# https://bugzilla.gnome.org/show_bug.cgi?id=732706 -Patch7: Allow-setting-up-quad-buffer-stereo-output.patch - -Patch8: add-driver-selection-api.patch -Patch9: video-memory-purge.patch - -Patch10: Enable-threaded-swap-wait.patch - -BuildRequires: glib2-devel mesa-libGL-devel pkgconfig pango-devel -BuildRequires: cairo-gobject-devel gdk-pixbuf2-devel atk-devel -BuildRequires: cogl-devel >= 1.18.2-12 -BuildRequires: gobject-introspection-devel >= 0.9.6 -BuildRequires: gtk3-devel -BuildRequires: json-glib-devel >= 0.12.0 -BuildRequires: libXcomposite-devel -BuildRequires: libXdamage-devel -BuildRequires: libXi-devel >= 1.7.4 -BuildRequires: gettext-devel +Source0: https://download.gnome.org/sources/%{name}/1.26/%{name}-%{version}.tar.xz + +BuildRequires: gettext +BuildRequires: pkgconfig(atk) +BuildRequires: pkgconfig(cairo-gobject) >= %{cairo_version} +BuildRequires: pkgconfig(cogl-1.0) >= %{cogl_version} +BuildRequires: pkgconfig(gdk-pixbuf-2.0) +BuildRequires: pkgconfig(gio-2.0) >= %{glib2_version} +BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.39.0 +BuildRequires: pkgconfig(gdk-3.0) +BuildRequires: pkgconfig(json-glib-1.0) >= %{json_glib_version} +BuildRequires: pkgconfig(pangocairo) +BuildRequires: pkgconfig(xcomposite) +BuildRequires: pkgconfig(xdamage) +BuildRequires: pkgconfig(xi) +BuildRequires: mesa-libGL-devel %if 0%{?with_wayland} -BuildRequires: libgudev1-devel -BuildRequires: libwayland-client-devel -BuildRequires: libwayland-cursor-devel -BuildRequires: libwayland-server-devel -BuildRequires: libxkbcommon-devel -BuildRequires: libinput-devel +BuildRequires: pkgconfig(gudev-1.0) +BuildRequires: pkgconfig(libinput) >= %{libinput_version} +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(xkbcommon) %endif +Requires: cairo%{?_isa} >= %{cairo_version} +Requires: cogl%{?_isa} >= %{cogl_version} +Requires: glib2%{?_isa} >= %{glib2_version} Requires: gobject-introspection +Requires: json-glib%{?_isa} >= %{json_glib_version} +%if 0%{?with_wayland} +Requires: libinput%{?_isa} >= %{libinput_version} +%endif %description Clutter is an open source software library for creating fast, @@ -85,13 +95,8 @@ the functionality of the installed clutter package. %prep %setup -q -%patch7 -p1 -b .quadbuffer-stereo -%patch8 -p1 -b .add-driver-selection-api -%patch9 -p1 -b .video-memory-purge -%patch10 -p1 -b .enable-threaded-swap-wait %build -autoreconf %configure \ --enable-xinput \ --enable-gdk-backend \ @@ -106,22 +111,20 @@ autoreconf make %{?_smp_mflags} V=1 %install -make install DESTDIR=%{buildroot} INSTALL='install -p' +%make_install #Remove libtool archives. find %{buildroot} -name '*.la' -delete %find_lang clutter-1.0 -%check -make check %{?_smp_mflags} V=1 - %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -f clutter-1.0.lang -%doc COPYING NEWS README +%doc NEWS README +%license COPYING %{_libdir}/*.so.0 %{_libdir}/*.so.0.* %{_libdir}/girepository-1.0/*.typelib @@ -134,7 +137,6 @@ make check %{?_smp_mflags} V=1 %files doc %{_datadir}/gtk-doc/html/clutter -%{_datadir}/gtk-doc/html/cally %if 0%{?with_tests} %files tests @@ -143,6 +145,10 @@ make check %{?_smp_mflags} V=1 %endif %changelog +* Mon Feb 06 2017 Kalev Lember - 1.26.0-1 +- Update to 1.26.0 +- Resolves: #1386832 + * Thu Aug 11 2016 Rui Matos - 1.20.0-10 - Add patches to make the backend driver selection explicit instead of changing the default to gl3