[mutter/wip/carlosg/performance-improvements: 35/38] ClutterActor: Preserve valid paint volumes till the next relayout/repaint
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/performance-improvements: 35/38] ClutterActor: Preserve valid paint volumes till the next relayout/repaint
- Date: Mon, 22 May 2017 15:44:40 +0000 (UTC)
commit 77fd682c8bd90425f40279ad9ba221c5da9361d3
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Apr 29 13:43:33 2017 +0200
ClutterActor: Preserve valid paint volumes till the next relayout/repaint
Cuts down approximately 55% of paint volumes calculation when there's
windows that redraw frequently, but don't move.
https://bugzilla.gnome.org/show_bug.cgi?id=782344
clutter/clutter/clutter-actor.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 002bb07..a54268b 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -840,6 +840,7 @@ struct _ClutterActorPrivate
guint needs_compute_expand : 1;
guint needs_x_expand : 1;
guint needs_y_expand : 1;
+ guint needs_paint_volume_update : 1;
};
enum
@@ -2619,6 +2620,7 @@ clutter_actor_real_allocate (ClutterActor *self,
g_object_freeze_notify (G_OBJECT (self));
changed = clutter_actor_set_allocation_internal (self, box, flags);
+ priv->needs_paint_volume_update = changed;
/* we allocate our children before we notify changes in our geometry,
* so that people connecting to properties will be able to get valid
@@ -2696,6 +2698,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
if (self != origin)
{
self->priv->is_dirty = TRUE;
+ self->priv->needs_paint_volume_update = TRUE;
self->priv->effect_to_redraw = NULL;
}
@@ -8525,6 +8528,7 @@ clutter_actor_init (ClutterActor *self)
priv->needs_width_request = TRUE;
priv->needs_height_request = TRUE;
priv->needs_allocation = TRUE;
+ priv->needs_paint_volume_update = TRUE;
priv->cached_width_age = 1;
priv->cached_height_age = 1;
@@ -8895,6 +8899,7 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
}
priv->is_dirty = TRUE;
+ priv->needs_paint_volume_update = TRUE;
}
/**
@@ -12952,6 +12957,7 @@ clutter_actor_add_child_internal (ClutterActor *self,
child->priv->needs_width_request = TRUE;
child->priv->needs_height_request = TRUE;
child->priv->needs_allocation = TRUE;
+ child->priv->needs_paint_volume_update = TRUE;
/* we only queue a relayout here, because any possible
* redraw has already been queued either by show() or
@@ -17475,16 +17481,22 @@ _clutter_actor_get_paint_volume_mutable (ClutterActor *self)
priv = self->priv;
if (priv->paint_volume_valid)
- clutter_paint_volume_free (&priv->paint_volume);
+ {
+ if (!priv->needs_paint_volume_update)
+ return &priv->paint_volume;
+ clutter_paint_volume_free (&priv->paint_volume);
+ }
if (_clutter_actor_get_paint_volume_real (self, &priv->paint_volume))
{
priv->paint_volume_valid = TRUE;
+ priv->needs_paint_volume_update = FALSE;
return &priv->paint_volume;
}
else
{
priv->paint_volume_valid = FALSE;
+ priv->needs_paint_volume_update = FALSE;
return NULL;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]