[mutter/f20] Fix crash on hardware that does not support GLSL

drago01 drago01 at fedoraproject.org
Sat Jul 26 06:26:31 UTC 2014


commit 2b1208f195f09d4449867eaf1effe1c52d8206f5
Author: Adel Gadllah <adel.gadllah at gmail.com>
Date:   Sat Jul 26 08:26:14 2014 +0200

    Fix crash on hardware that does not support GLSL

 ...ackground-Do-not-assume-GLSL-is-available.patch |   64 ++++++++++++++++++++
 mutter.spec                                        |    7 ++-
 2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/0001-background-Do-not-assume-GLSL-is-available.patch b/0001-background-Do-not-assume-GLSL-is-available.patch
new file mode 100644
index 0000000..f5e9a70
--- /dev/null
+++ b/0001-background-Do-not-assume-GLSL-is-available.patch
@@ -0,0 +1,64 @@
+From 72ec20e48f085af729c5b0afdd78d259694a052a Mon Sep 17 00:00:00 2001
+From: Adel Gadllah <adel.gadllah at gmail.com>
+Date: Thu, 24 Jul 2014 15:39:26 +0200
+Subject: [PATCH] background: Do not assume GLSL is available
+
+Some hardware does not support it causing crashes in cogl during paint.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=733623
+---
+ src/compositor/meta-background.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
+index 6eee159..ae6f459 100644
+--- a/src/compositor/meta-background.c
++++ b/src/compositor/meta-background.c
+@@ -501,7 +501,8 @@ set_brightness (MetaBackground *self,
+ 
+   priv->brightness = brightness;
+ 
+-  if (priv->effects & META_BACKGROUND_EFFECTS_VIGNETTE)
++  if (clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL) &&
++      priv->effects & META_BACKGROUND_EFFECTS_VIGNETTE)
+     {
+       ensure_pipeline (self);
+       cogl_pipeline_set_uniform_1f (priv->pipeline,
+@@ -509,6 +510,14 @@ set_brightness (MetaBackground *self,
+                                                                         "brightness"),
+                                     priv->brightness);
+     }
++  else
++    {
++      ensure_pipeline (self);
++      CoglColor blend_color;
++      cogl_color_init_from_4f (&blend_color, brightness, brightness, brightness, 1.0);
++      cogl_pipeline_set_layer_combine (priv->pipeline, 1, "RGB=MODULATE(PREVIOUS, CONSTANT) A=REPLACE(PREVIOUS)", NULL);
++      cogl_pipeline_set_layer_combine_constant (priv->pipeline, 1, &blend_color);
++    }
+ 
+   clutter_content_invalidate (CLUTTER_CONTENT (self));
+ 
+@@ -526,6 +535,9 @@ set_vignette_sharpness (MetaBackground *self,
+ 
+   priv->vignette_sharpness = sharpness;
+ 
++  if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
++    return;
++
+   if (priv->effects & META_BACKGROUND_EFFECTS_VIGNETTE)
+     {
+       ensure_pipeline (self);
+@@ -546,6 +558,9 @@ add_vignette (MetaBackground *self)
+   MetaBackgroundPrivate *priv = self->priv;
+   static CoglSnippet *snippet = NULL;
+ 
++  if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
++    return;
++
+   ensure_pipeline (self);
+ 
+   /* Cogl automatically caches pipelines with no eviction policy,
+-- 
+1.9.3
+
diff --git a/mutter.spec b/mutter.spec
index 9de2528..b4da0ad 100644
--- a/mutter.spec
+++ b/mutter.spec
@@ -1,6 +1,6 @@
 Name:          mutter
 Version:       3.10.4
-Release:       2%{?dist}
+Release:       3%{?dist}
 Summary:       Window and compositing manager based on Clutter
 
 Group:         User Interface/Desktops
@@ -10,6 +10,7 @@ URL:           http://www.gnome.org
 Source0:       http://download.gnome.org/sources/%{name}/3.10/%{name}-%{version}.tar.xz
 
 Patch1: 0001-window-actor-Guard-against-NULL-frame-mask.patch
+Patch2: 0001-background-Do-not-assume-GLSL-is-available.patch
 
 BuildRequires: clutter-devel >= 1.13.5
 BuildRequires: pango-devel
@@ -67,6 +68,7 @@ utilities for testing Metacity/Mutter themes.
 %prep
 %setup -q
 %patch1 -p1 -b .prevent-crash-with-overly-large-windows
+%patch2 -p1 -b .fix-glsl-crash
 
 %build
 (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; fi;
@@ -130,6 +132,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %exclude %{_datadir}/gtk-doc
 
 %changelog
+* Thu Jul 24 2014 Adel Gadllah <adel.gadllah at gmail.com> - 3.10.4-3
+- Fix crash when GLSL is not available (#1046970)
+
 * Thu Apr 10 2014 Florian Müllner <fmuellner at redhat.com> - 3.10.4-2
 - Backport patch to prevent crash with overly large windows (#1043659)
 


More information about the scm-commits mailing list