[clutter/f20] Avoid excessive redraws

Matthias Clasen mclasen at fedoraproject.org
Wed Nov 27 02:22:26 UTC 2013


commit f17f73a21a621c8a58018b766d187865c2836223
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Tue Nov 26 21:22:09 2013 -0500

    Avoid excessive redraws

 ...aints-Don-t-force-redraws-on-source-relay.patch |   83 ++++++++++++++++++++
 ...-redraws-when-reallocating-actor-that-hav.patch |   59 ++++++++++++++
 clutter.spec                                       |   10 ++-
 3 files changed, 151 insertions(+), 1 deletions(-)
---
diff --git a/0001-Bind-constraints-Don-t-force-redraws-on-source-relay.patch b/0001-Bind-constraints-Don-t-force-redraws-on-source-relay.patch
new file mode 100644
index 0000000..7f690dc
--- /dev/null
+++ b/0001-Bind-constraints-Don-t-force-redraws-on-source-relay.patch
@@ -0,0 +1,83 @@
+From fc2a5cfe195fda9d79615fbde140b5ea7dd45b0b Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor at fishsoup.net>
+Date: Fri, 22 Nov 2013 10:30:21 -0500
+Subject: [PATCH 1/2] Bind constraints: Don't force redraws on source relayout
+
+When the source actor potentially changes size, that shouldn't
+necessarily result in the target actor being redrawn - it should
+be like when a child of a container is reallocated due to changes
+in its siblings or parent - it should redraw only to the extent
+that it is moved and resized. Privately export an internal function
+from clutter-actor.c to allow getting this right.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=719367
+---
+ clutter/clutter-actor-private.h   | 1 +
+ clutter/clutter-actor.c           | 4 +---
+ clutter/clutter-bind-constraint.c | 2 +-
+ clutter/clutter-snap-constraint.c | 2 +-
+ 4 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/clutter/clutter-actor-private.h b/clutter/clutter-actor-private.h
+index 1c6f165..8bcf26c 100644
+--- a/clutter/clutter-actor-private.h
++++ b/clutter/clutter-actor-private.h
+@@ -318,6 +318,7 @@ void                            _clutter_actor_detach_clone
+                                                                                          ClutterActor *clone);
+ void                            _clutter_actor_queue_redraw_on_clones                   (ClutterActor *actor);
+ void                            _clutter_actor_queue_relayout_on_clones                 (ClutterActor *actor);
++void                            _clutter_actor_queue_only_relayout                      (ClutterActor *actor);
+ 
+ G_END_DECLS
+ 
+diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
+index 4ceb62c..4504ac6 100644
+--- a/clutter/clutter-actor.c
++++ b/clutter/clutter-actor.c
+@@ -1037,8 +1037,6 @@ static void           clutter_anchor_coord_set_gravity (AnchorCoord       *coord
+ 
+ static gboolean clutter_anchor_coord_is_zero (const AnchorCoord *coord);
+ 
+-static void _clutter_actor_queue_only_relayout (ClutterActor *self);
+-
+ static void _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
+                                                                ClutterActor *ancestor,
+                                                                CoglMatrix *matrix);
+@@ -8862,7 +8860,7 @@ _clutter_actor_queue_redraw_with_clip (ClutterActor       *self,
+                                     NULL /* effect */);
+ }
+ 
+-static void
++void
+ _clutter_actor_queue_only_relayout (ClutterActor *self)
+ {
+   ClutterActorPrivate *priv = self->priv;
+diff --git a/clutter/clutter-bind-constraint.c b/clutter/clutter-bind-constraint.c
+index b9e45ab..fa94906 100644
+--- a/clutter/clutter-bind-constraint.c
++++ b/clutter/clutter-bind-constraint.c
+@@ -151,7 +151,7 @@ source_queue_relayout (ClutterActor          *source,
+                        ClutterBindConstraint *bind)
+ {
+   if (bind->actor != NULL)
+-    clutter_actor_queue_relayout (bind->actor);
++    _clutter_actor_queue_only_relayout (bind->actor);
+ }
+ 
+ static void
+diff --git a/clutter/clutter-snap-constraint.c b/clutter/clutter-snap-constraint.c
+index c8eaea9..b4c558f 100644
+--- a/clutter/clutter-snap-constraint.c
++++ b/clutter/clutter-snap-constraint.c
+@@ -94,7 +94,7 @@ source_queue_relayout (ClutterActor          *source,
+                        ClutterSnapConstraint *constraint)
+ {
+   if (constraint->actor != NULL)
+-    clutter_actor_queue_relayout (constraint->actor);
++    _clutter_actor_queue_only_relayout (constraint->actor);
+ }
+ 
+ static void
+-- 
+1.8.4.2
+
diff --git a/0002-Don-t-queue-redraws-when-reallocating-actor-that-hav.patch b/0002-Don-t-queue-redraws-when-reallocating-actor-that-hav.patch
new file mode 100644
index 0000000..f6f12d2
--- /dev/null
+++ b/0002-Don-t-queue-redraws-when-reallocating-actor-that-hav.patch
@@ -0,0 +1,59 @@
+From 224e0ee7de1fc09adc9eed031f55569d219c567e Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor at fishsoup.net>
+Date: Tue, 26 Nov 2013 11:04:27 -0500
+Subject: [PATCH 2/2] Don't queue redraws when reallocating actor that haven't
+ moved
+
+When support for implicit animation of actor position was added,
+the optimization for not queueing when allocating an actor back
+to the same location was lost. This optimization is important
+since when we are hierarchically allocating down from the top of
+the stage we constantly reallocate the actors at the top of the
+hierarchy back to the same place.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=719368
+---
+ clutter/clutter-actor.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
+index 4504ac6..b371183 100644
+--- a/clutter/clutter-actor.c
++++ b/clutter/clutter-actor.c
+@@ -9738,7 +9738,9 @@ clutter_actor_allocate_internal (ClutterActor           *self,
+ 
+   CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
+ 
+-  clutter_actor_queue_redraw (self);
++  /* Caller should call clutter_actor_queue_redraw() if needed
++   * for that particular case.
++   */
+ }
+ 
+ /**
+@@ -9847,6 +9849,14 @@ clutter_actor_allocate (ClutterActor           *self,
+       return;
+     }
+ 
++  if (!stage_allocation_changed)
++    {
++      /* If the actor didn't move but needs_allocation is set, we just
++       * need to allocate the children */
++      clutter_actor_allocate_internal (self, &real_allocation, flags);
++      return;
++    }
++
+   /* When ABSOLUTE_ORIGIN_CHANGED is passed in to
+    * clutter_actor_allocate(), it indicates whether the parent has its
+    * absolute origin moved; when passed in to ClutterActor::allocate()
+@@ -14718,6 +14728,7 @@ clutter_actor_set_animatable_property (ClutterActor *actor,
+       clutter_actor_allocate_internal (actor,
+                                        g_value_get_boxed (value),
+                                        actor->priv->allocation_flags);
++      clutter_actor_queue_redraw (actor);
+       break;
+ 
+     case PROP_DEPTH:
+-- 
+1.8.4.2
+
diff --git a/clutter.spec b/clutter.spec
index 9677c60..f819379 100644
--- a/clutter.spec
+++ b/clutter.spec
@@ -6,7 +6,7 @@
 
 Name:          clutter
 Version:       1.16.2
-Release:       1%{?dist}
+Release:       2%{?dist}
 Summary:       Open Source software library for creating rich graphical user interfaces
 
 Group:         Development/Libraries
@@ -14,6 +14,9 @@ License:       LGPLv2+
 URL:           http://www.clutter-project.org/
 Source0:       http://download.gnome.org/sources/clutter/1.16/clutter-%{version}.tar.xz
 Patch0: clutter-1.16.0-fix-evdev-touchpad.patch
+# upstream fixes, to avoid excessive redraws
+Patch1: 0001-Bind-constraints-Don-t-force-redraws-on-source-relay.patch
+Patch2: 0002-Don-t-queue-redraws-when-reallocating-actor-that-hav.patch
 
 BuildRequires: glib2-devel mesa-libGL-devel pkgconfig pango-devel
 BuildRequires: cairo-gobject-devel gdk-pixbuf2-devel atk-devel
@@ -81,6 +84,8 @@ This package contains documentation for clutter.
 %prep
 %setup -q
 %patch0 -p1 -b .touch
+%patch1 -p1 -b .redraws1
+%patch2 -p1 -b .redraws2
 
 %build
 (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
@@ -132,6 +137,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
 %{_datadir}/gtk-doc/html/cally
 
 %changelog
+* Tue Nov 26 2013 Matthias Clasen <mclasen at redhat.com> - 1.16.2-2
+- Avoid excessive redraws when windows are moved in gnome-shell
+
 * Thu Nov 21 2013 Richard Hughes <rhughes at redhat.com> - 1.16.2-1
 - Update to 1.16.2
 


More information about the scm-commits mailing list