From f7ebbd25fab1b5309462a98148f93ea4d8885223 Mon Sep 17 00:00:00 2001 From: Alexandre Rostovtsev Date: Sat, 31 Dec 2011 19:19:17 +0000 Subject: Add useful patches from upstream; fixes totem on old video cards (thanks to Rafał Mużyło for reporting), font rendering, offscreen effect efficiency. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Portage version: 2.2.0_alpha84/cvs/Linux x86_64) --- media-libs/clutter/ChangeLog | 13 +++- media-libs/clutter/clutter-1.8.2-r1.ebuild | 90 ++++++++++++++++++++++ ...er-1.8.2-cogl-fallback-to-non-transparent.patch | 62 +++++++++++++++ .../files/clutter-1.8.2-default-resolution.patch | 56 ++++++++++++++ .../files/clutter-1.8.2-em-computation.patch | 38 +++++++++ ...clutter-1.8.2-offscreen-effect-actor-size.patch | 78 +++++++++++++++++++ 6 files changed, 336 insertions(+), 1 deletion(-) create mode 100644 media-libs/clutter/clutter-1.8.2-r1.ebuild create mode 100644 media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch create mode 100644 media-libs/clutter/files/clutter-1.8.2-default-resolution.patch create mode 100644 media-libs/clutter/files/clutter-1.8.2-em-computation.patch create mode 100644 media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch diff --git a/media-libs/clutter/ChangeLog b/media-libs/clutter/ChangeLog index f50f97a42e57..af2079c654d7 100644 --- a/media-libs/clutter/ChangeLog +++ b/media-libs/clutter/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for media-libs/clutter # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/clutter/ChangeLog,v 1.44 2011/10/28 22:16:39 tetromino Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/clutter/ChangeLog,v 1.45 2011/12/31 19:19:17 tetromino Exp $ + +*clutter-1.8.2-r1 (31 Dec 2011) + + 31 Dec 2011; Alexandre Rostovtsev + +clutter-1.8.2-r1.ebuild, + +files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch, + +files/clutter-1.8.2-default-resolution.patch, + +files/clutter-1.8.2-em-computation.patch, + +files/clutter-1.8.2-offscreen-effect-actor-size.patch: + Add useful patches from upstream; fixes totem on old video cards (thanks to + Rafał Mużyło for reporting), font rendering, offscreen effect efficiency. *clutter-1.8.2 (28 Oct 2011) diff --git a/media-libs/clutter/clutter-1.8.2-r1.ebuild b/media-libs/clutter/clutter-1.8.2-r1.ebuild new file mode 100644 index 000000000000..d14239af7670 --- /dev/null +++ b/media-libs/clutter/clutter-1.8.2-r1.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/clutter/clutter-1.8.2-r1.ebuild,v 1.1 2011/12/31 19:19:17 tetromino Exp $ + +EAPI="4" +CLUTTER_LA_PUNT="yes" +WANT_AUTOMAKE="1.11" + +# Inherit gnome2 after clutter to download sources from gnome.org +# since clutter-project.org doesn't provide .xz tarballs +inherit clutter gnome2 + +DESCRIPTION="Clutter is a library for creating graphical user interfaces" + +SLOT="1.0" +IUSE="debug doc +introspection" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" + +# NOTE: glx flavour uses libdrm + >=mesa-7.3 +# XXX: uprof needed for profiling +# >=libX11-1.3.1 needed for X Generic Event support +RDEPEND=" + >=dev-libs/glib-2.28:2 + >=dev-libs/atk-2.1.5[introspection?] + >=dev-libs/json-glib-0.12[introspection?] + >=media-libs/cogl-1.8.0:1.0[introspection?,pango] + media-libs/fontconfig + >=x11-libs/cairo-1.10[glib] + x11-libs/gdk-pixbuf:2 + >=x11-libs/pango-1.20[introspection?] + + virtual/opengl + x11-libs/libdrm + >=x11-libs/libX11-1.3.1 + x11-libs/libXext + x11-libs/libXdamage + x11-proto/inputproto + >=x11-libs/libXi-1.3 + >=x11-libs/libXfixes-3 + >=x11-libs/libXcomposite-0.4 + + introspection? ( >=dev-libs/gobject-introspection-0.9.6 )" +DEPEND="${RDEPEND} + sys-devel/gettext + dev-util/pkgconfig + >=dev-util/gtk-doc-am-1.13 + doc? ( + >=dev-util/gtk-doc-1.13 + >=app-text/docbook-sgml-utils-0.6.14[jadetex] + dev-libs/libxslt )" + +pkg_setup() { + DOCS="README NEWS ChangeLog*" + + # XXX: Conformance test suite (and clutter itself) does not work under Xvfb + # XXX: Profiling, coverage disabled for now + # XXX: What about eglx/eglnative/opengl-egl-xlib/osx/wayland/etc flavours? + # Uses gudev-1.0 and libxkbcommon for eglnative/cex1000 + myconf="--enable-debug=minimum" + use debug && myconf="--enable-debug=yes" + G2CONF="${G2CONF} ${myconf} + --enable-conformance=no + --disable-gcov + --enable-profile=no + --enable-maintainer-flags=no + --enable-xinput + --with-flavour=glx + $(use_enable introspection) + $(use_enable doc docs)" +} + +src_prepare() { + # Useful patches fom upstream, will be in next release + epatch "${FILESDIR}/${P}-cogl-fallback-to-non-transparent.patch" + epatch "${FILESDIR}/${P}-offscreen-effect-actor-size.patch" + epatch "${FILESDIR}/${P}-default-resolution.patch" + epatch "${FILESDIR}/${P}-em-computation.patch" + + gnome2_src_prepare + + # We only need conformance tests, the rest are useless for us + sed -e 's/^\(SUBDIRS =\).*/\1/g' \ + -i tests/Makefile.am || die "am tests sed failed" + sed -e 's/^\(SUBDIRS =\)[^\]*/\1/g' \ + -i tests/Makefile.in || die "in tests sed failed" +} + +src_install() { + clutter_src_install +} diff --git a/media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch b/media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch new file mode 100644 index 000000000000..cdf7c79a0ca4 --- /dev/null +++ b/media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch @@ -0,0 +1,62 @@ +From f05432d57e5e980d0841fd6c13a7f886a46107fe Mon Sep 17 00:00:00 2001 +From: Robert Bragg +Date: Tue, 1 Nov 2011 13:42:40 +0000 +Subject: [PATCH] cogl: fallback to non-transparent stages if unsupported + +If our check of the CoglOnscreenTemplate during initialization fails +then we disable the request for an alpha component in the swap chain and +try the check again. + +Reviewed-by: Neil Roberts +Reviewed-by: Emmanuele Bassi +--- + clutter/cogl/clutter-backend-cogl.c | 26 +++++++++++++++++++++++--- + 1 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/clutter/cogl/clutter-backend-cogl.c b/clutter/cogl/clutter-backend-cogl.c +index 1ca8850..1343dd1 100644 +--- a/clutter/cogl/clutter-backend-cogl.c ++++ b/clutter/cogl/clutter-backend-cogl.c +@@ -296,6 +296,7 @@ clutter_backend_cogl_create_context (ClutterBackend *backend, + #endif + CoglSwapChain *swap_chain = NULL; + CoglOnscreenTemplate *onscreen_template = NULL; ++ gboolean status; + + if (backend->cogl_context) + return TRUE; +@@ -325,9 +326,28 @@ clutter_backend_cogl_create_context (ClutterBackend *backend, + * Conceptually should we be able to check an onscreen_template + * without more details about the CoglDisplay configuration? + */ +- if (!cogl_renderer_check_onscreen_template (backend->cogl_renderer, +- onscreen_template, +- error)) ++ status = cogl_renderer_check_onscreen_template (backend->cogl_renderer, ++ onscreen_template, ++ error); ++#ifdef COGL_HAS_XLIB_SUPPORT ++ if (!status && clutter_x11_get_use_argb_visual ()) ++ { ++ g_clear_error (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. ++ */ ++ cogl_swap_chain_set_has_alpha (swap_chain, FALSE); ++ status = cogl_renderer_check_onscreen_template (backend->cogl_renderer, ++ onscreen_template, ++ error); ++ } ++#endif ++ ++ if (!status) + goto error; + + backend->cogl_display = cogl_display_new (backend->cogl_renderer, +-- +1.7.8.1 + diff --git a/media-libs/clutter/files/clutter-1.8.2-default-resolution.patch b/media-libs/clutter/files/clutter-1.8.2-default-resolution.patch new file mode 100644 index 000000000000..ddf65aac6a4c --- /dev/null +++ b/media-libs/clutter/files/clutter-1.8.2-default-resolution.patch @@ -0,0 +1,56 @@ +From 0e6e3a5d4b51331df8df5bebd60195fbcf5caec5 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Mon, 5 Dec 2011 11:42:49 +0000 +Subject: [PATCH] backend: Return the correct default resolution +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If ClutterSettings:font-dpi is set to -1 then the default resolution +should be returned by ClutterBackend — i.e. 96.0. +(cherry picked from commit 943a65b476431400bd0436e1be243a2917385866) + +Signed-off-by: Emmanuele Bassi +--- + clutter/clutter-backend.c | 11 ++++++++++- + 1 files changed, 10 insertions(+), 1 deletions(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 80e4853..8267544 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -179,14 +179,20 @@ clutter_backend_real_resolution_changed (ClutterBackend *backend) + ClutterBackendPrivate *priv = backend->priv; + ClutterMainContext *context; + ClutterSettings *settings; ++ gdouble resolution; + gint dpi; + + settings = clutter_settings_get_default (); + g_object_get (settings, "font-dpi", &dpi, NULL); + ++ if (dpi < 0) ++ resolution = 96.0; ++ else ++ resolution = dpi / 1024.0; ++ + context = _clutter_context_get_default (); + if (context->font_map != NULL) +- cogl_pango_font_map_set_resolution (context->font_map, dpi / 1024.0); ++ cogl_pango_font_map_set_resolution (context->font_map, resolution); + + priv->units_per_em = get_units_per_em (backend, NULL); + priv->units_serial += 1; +@@ -788,6 +794,9 @@ clutter_backend_get_resolution (ClutterBackend *backend) + settings = clutter_settings_get_default (); + g_object_get (settings, "font-dpi", &resolution, NULL); + ++ if (resolution < 0) ++ return 96.0; ++ + return resolution / 1024.0; + } + +-- +1.7.8.1 + diff --git a/media-libs/clutter/files/clutter-1.8.2-em-computation.patch b/media-libs/clutter/files/clutter-1.8.2-em-computation.patch new file mode 100644 index 000000000000..3b4d3f4f21b3 --- /dev/null +++ b/media-libs/clutter/files/clutter-1.8.2-em-computation.patch @@ -0,0 +1,38 @@ +From 85a466268360ad007de90e34b24fa0f56692eaa8 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Mon, 5 Dec 2011 11:43:48 +0000 +Subject: [PATCH] backend: Fix em computation for non-absolute fonts + +If a font description is not set to have an absolute size then we were +using the wrong transformation for points to device units. +(cherry picked from commit 158245fda31e7adad38aa49e4c12efcad0e326e0) + +Signed-off-by: Emmanuele Bassi +--- + clutter/clutter-backend.c | 8 ++------ + 1 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c +index 8267544..db0a637 100644 +--- a/clutter/clutter-backend.c ++++ b/clutter/clutter-backend.c +@@ -155,14 +155,10 @@ get_units_per_em (ClutterBackend *backend, + if (is_absolute) + font_size = (gdouble) pango_size / PANGO_SCALE; + else +- font_size = (gdouble) pango_size / PANGO_SCALE +- * dpi +- / 96.0f; ++ font_size = dpi * ((gdouble) pango_size / PANGO_SCALE) / 72.0f; + + /* 10 points at 96 DPI is 13.3 pixels */ +- units_per_em = (1.2f * font_size) +- * dpi +- / 96.0f; ++ units_per_em = (1.2f * font_size) * dpi / 96.0f; + } + else + units_per_em = -1.0f; +-- +1.7.8.1 + diff --git a/media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch b/media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch new file mode 100644 index 000000000000..b5711af252ea --- /dev/null +++ b/media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch @@ -0,0 +1,78 @@ +From 2e5980612bb0f27c1616960a5b4bcd3898af14c0 Mon Sep 17 00:00:00 2001 +From: Neil Roberts +Date: Mon, 28 Nov 2011 13:08:57 +0000 +Subject: [PATCH] offscreen-effect: Track the size of the actor separately + +Previously the offscreen effect was keeping track of the size of the +texture so that it could detect when a different size is requested and +create a new texture. However this breaks if a subclass overrides +create_texture to make the texture bigger because in that case the +size of the texture will always be different from the calculated size +of the actor. This patch makes it also track the size of the fbo that +was requested before being passed through create_texture() and it +instead uses that to detect when a new FBO is needed. + +https://bugzilla.gnome.org/show_bug.cgi?id=665040 + +Reviewed-by: Emmanuele Bassi + +(cherry picked from commit a2774fb0dcce0c92036b69fb75092ec8dc80905d) +--- + clutter/clutter-offscreen-effect.c | 17 +++++++++++++++-- + 1 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c +index cf0d07c..071b415 100644 +--- a/clutter/clutter-offscreen-effect.c ++++ b/clutter/clutter-offscreen-effect.c +@@ -85,9 +85,17 @@ struct _ClutterOffscreenEffectPrivate + gfloat x_offset; + gfloat y_offset; + ++ /* The size of the texture */ + gfloat target_width; + gfloat target_height; + ++ /* This is the calculated size of the fbo before being passed ++ through create_texture(). This needs to be tracked separately so ++ that we can detect when a different size is calculated and ++ regenerate the fbo */ ++ int fbo_width; ++ int fbo_height; ++ + gint old_opacity_override; + + /* The matrix that was current the last time the fbo was updated. We +@@ -154,8 +162,8 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height) + return FALSE; + } + +- if (priv->target_width == fbo_width && +- priv->target_height == fbo_height && ++ if (priv->fbo_width == fbo_width && ++ priv->fbo_height == fbo_height && + priv->offscreen != COGL_INVALID_HANDLE) + return TRUE; + +@@ -187,6 +195,9 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height) + priv->target_width = cogl_texture_get_width (texture); + priv->target_height = cogl_texture_get_height (texture); + ++ priv->fbo_width = fbo_width; ++ priv->fbo_height = fbo_height; ++ + if (priv->offscreen != COGL_INVALID_HANDLE) + cogl_handle_unref (priv->offscreen); + +@@ -200,6 +211,8 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height) + + priv->target_width = 0; + priv->target_height = 0; ++ priv->fbo_width = 0; ++ priv->fbo_height = 0; + + return FALSE; + } +-- +1.7.8.1 + -- cgit v1.2.3-65-gdbad