Add useful patches from upstream; fixes totem on old video cards (thanks to Rafał...
authorAlexandre Rostovtsev <tetromino@gentoo.org>
Sat, 31 Dec 2011 19:19:17 +0000 (19:19 +0000)
committerAlexandre Rostovtsev <tetromino@gentoo.org>
Sat, 31 Dec 2011 19:19:17 +0000 (19:19 +0000)
Package-Manager: portage-2.2.0_alpha84/cvs/Linux x86_64

media-libs/clutter/ChangeLog
media-libs/clutter/Manifest
media-libs/clutter/clutter-1.8.2-r1.ebuild [new file with mode: 0644]
media-libs/clutter/files/clutter-1.8.2-cogl-fallback-to-non-transparent.patch [new file with mode: 0644]
media-libs/clutter/files/clutter-1.8.2-default-resolution.patch [new file with mode: 0644]
media-libs/clutter/files/clutter-1.8.2-em-computation.patch [new file with mode: 0644]
media-libs/clutter/files/clutter-1.8.2-offscreen-effect-actor-size.patch [new file with mode: 0644]

index f50f97a42e57223040585b57e439a1c4e583645c..af2079c654d71828aba2b8321b3e8464c7e3fb89 100644 (file)
@@ -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 <tetromino@gentoo.org>
+  +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)
 
index f0b392983f6cb83e5d62b225057f43c52b0bd2fc..ba176ea92fd88f9ad98d4c309d203eb7a5a4cba8 100644 (file)
@@ -1,6 +1,10 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256
 
+AUX clutter-1.8.2-cogl-fallback-to-non-transparent.patch 2536 RMD160 94cd9c71826b572d08e3c4c9069086a4a6b9bb1a SHA1 fc988984784c11dfabc6db31988cf075c314a627 SHA256 664ce084745af2af753bfa9aadec5ef6f6e4d17d0c292840688a32f200417be4
+AUX clutter-1.8.2-default-resolution.patch 1832 RMD160 b7fd51acbff2243688213f380c0257060e0fc3e7 SHA1 89388a719a12424c0a0899ef7f944b174bc9835f SHA256 1175b1a4f603715706d7b9c6840ad0fd902e82b4014100258e862deab9142787
+AUX clutter-1.8.2-em-computation.patch 1342 RMD160 0b3dc2f5264dd969be5c39cff123c6e111c1cc6d SHA1 a6f793c05141e2b7b7a46ce8f1f42f898a242482 SHA256 8e9d727f3f135e2b740a6bd97654dff8b7352fd32a4020903a877f482959ba07
+AUX clutter-1.8.2-offscreen-effect-actor-size.patch 2769 RMD160 6aff75109844bc74ddc0bdbfc030fa9c3921bac0 SHA1 88777abf2139b5f3377bd6140c7df7d9a6f747d7 SHA256 27a676201687de552aca8e0c10759721ec252fa5e57b538bbe8a7f395dffd9d3
 DIST clutter-1.2.14.tar.bz2 2405660 RMD160 2498feed53d78946b6336b501711493d99abfe74 SHA1 bd8f770c3f3b48954652e87a100d2659bee2176d SHA256 f9b7e6b8338662f8b0961579f6ad0f56b6696e65f2f122353fa0390959acc744
 DIST clutter-1.6.16.tar.xz 4507324 RMD160 d094cda4d1534e9323a8d7bfd47716d247da2b44 SHA1 19e5ecdcd2c439a64a2333fa09b6ef0858ee7bbc SHA256 206517f8f74252105c46762d11a973b2bae3f2702d2d2ed0cac1206ff5605d9b
 DIST clutter-1.6.20.tar.xz 4519228 RMD160 b30704928847e4c80ad99b320f5c96e28c47084b SHA1 8329450f9dfe63050a74ac9598054f23371a4c74 SHA256 c5508856e51343ef0f5cf5a8526e4372ac96d31b740d6b09d37e890c653b4273
@@ -8,13 +12,14 @@ DIST clutter-1.8.2.tar.xz 4457440 RMD160 a5f7a5d112525a6185d225c4500c1396e9fe322
 EBUILD clutter-1.2.14.ebuild 1783 RMD160 ac19744af1524c10463b0c91e66dbff6fd227e8a SHA1 108fbd832e5f5c1b589fe66134fdf4243aedb396 SHA256 0409fcbec6465414ea08985fdf5494f519a5492556fb174ff551bb91b99c70e1
 EBUILD clutter-1.6.16.ebuild 2306 RMD160 955d6b5005e84aa430cb70b99f9d230e3268987d SHA1 f23a01899bb10504a0c219516387626861237a72 SHA256 b24362cde437b27fe86720e61055a1662e389ee8cab8c67944190f0806e4baa0
 EBUILD clutter-1.6.20.ebuild 2304 RMD160 d36baecbc9bd186b640d36b2b4be039bdd03b1af SHA1 6af7873e62a70e9421b0ddcbe4f5d1eb22ff0033 SHA256 b40ef2437e9d06dbe46e104bdab7a448307324f2b53e116f08f096a4e2a629ed
+EBUILD clutter-1.8.2-r1.ebuild 2650 RMD160 e5b66a2dcb28a6e8b31732fb81ce2cb8211e25da SHA1 7d4b68365e481a38b24ffc52cbeca8ae8a5c5b43 SHA256 7061407a472bb624b426fd3f8435425adceca60463a50858cb613c7993d2cde3
 EBUILD clutter-1.8.2.ebuild 2363 RMD160 0fc8310e5395524653c112b3aec6e3b42c64e418 SHA1 732becb3a20f21edb3201221c03f40c1806b6772 SHA256 ade51578f602803b84e6b08cae9ca7c22149c3735bfbc457e94b662fa6c39519
-MISC ChangeLog 7090 RMD160 55adc0fde69e1d8a7a2e6d3c3ff59f689e17ec3d SHA1 531ea468abedb311636748fb6db74f6497941010 SHA256 7d06cda5200721fd5c0522cf6240922b0bc88f48ba03f234f0476d1402ad25fb
+MISC ChangeLog 7583 RMD160 9a4b57e0a85408f4cf7c72e39ec1265cc1f4bae0 SHA1 a207565142cfb8fb30b97685b9f0021752a81376 SHA256 a997a1bca36846eed3088160af72223d1db7ff77f9b1d8453bae2fd6bc86fcf2
 MISC metadata.xml 369 RMD160 e3e3636a5afeb148f237e04d5fdbbcd59290d615 SHA1 7d2624a645199395fc46f07da920dc024dc7918e SHA256 32aaa1d48a8c5b7837ada4c3d705d4a4d58280b4454d53cc6ef34f43e0675696
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
-iF4EAREIAAYFAk6rKc0ACgkQdjK8w9WeBnBnZAD+IuFgayOQEvSSLntNtCzTxjH5
-M8rI0rGtM7KGkaORDY4BALdUD8syxoUTeUYN5mCZNV1glI1j+iOKe88DxrfvbVzn
-=IQGE
+iF4EAREIAAYFAk7/YDsACgkQdjK8w9WeBnC6AAD8CJ9XqWLayFx1dcGZsMzXYSD2
+CPfGldGx+xmAtS1rYU0BAK7cO33QMUU15MY4x49NUY2kcJ8AYovP22d/WeFejCyx
+=Qo9G
 -----END PGP SIGNATURE-----
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 (file)
index 0000000..d14239a
--- /dev/null
@@ -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 (file)
index 0000000..cdf7c79
--- /dev/null
@@ -0,0 +1,62 @@
+From f05432d57e5e980d0841fd6c13a7f886a46107fe Mon Sep 17 00:00:00 2001
+From: Robert Bragg <robert@linux.intel.com>
+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 <neil@linux.intel.com>
+Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
+---
+ 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 (file)
index 0000000..ddf65aa
--- /dev/null
@@ -0,0 +1,56 @@
+From 0e6e3a5d4b51331df8df5bebd60195fbcf5caec5 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@linux.intel.com>
+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 <ebassi@linux.intel.com>
+---
+ 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 (file)
index 0000000..3b4d3f4
--- /dev/null
@@ -0,0 +1,38 @@
+From 85a466268360ad007de90e34b24fa0f56692eaa8 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@linux.intel.com>
+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 <ebassi@linux.intel.com>
+---
+ 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 (file)
index 0000000..b5711af
--- /dev/null
@@ -0,0 +1,78 @@
+From 2e5980612bb0f27c1616960a5b4bcd3898af14c0 Mon Sep 17 00:00:00 2001
+From: Neil Roberts <neil@linux.intel.com>
+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 <ebassi@linux.intel.com>
+
+(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
+