mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
x11: Use has_allocation() in TfP actor
ClutterX11TexturePixmap calls get_allocation_box() when queueing a clipped redraw. If the allocation is not valid, and if we queue a lot of redraws in response to a series of damage events, the net result is that we spend all our time in a re-layout. We can short-circuit this by checking if the actor has a valid allocation, and if not, just queue a redraw - the actor will be allocated by the time it is going to be painted. Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
8df4a0b8fd
commit
6fcc8c5bce
@ -435,14 +435,18 @@ clutter_x11_texture_pixmap_real_queue_damage_redraw (
|
||||
* actor coordinates...
|
||||
*/
|
||||
|
||||
/* XXX: we don't care if we get an out of date allocation here because
|
||||
* clutter_actor_queue_clipped_redraw knows to ignore the clip if the
|
||||
* actor's allocation is invalid.
|
||||
*
|
||||
* This is noted because clutter_actor_get_allocation_box does some
|
||||
* unnecessary work to support buggy code with a comment suggesting that
|
||||
* it could be changed later which would be good for this use case!
|
||||
/* Calling clutter_actor_get_allocation_box() is enormously expensive
|
||||
* if the actor has an out-of-date allocation, since it triggers
|
||||
* a full redraw. clutter_actor_queue_clipped_redraw() would redraw
|
||||
* the whole stage anyways in that case, so just go ahead and do
|
||||
* it here.
|
||||
*/
|
||||
if (!clutter_actor_has_allocation (self))
|
||||
{
|
||||
clutter_actor_queue_redraw (self);
|
||||
return;
|
||||
}
|
||||
|
||||
clutter_actor_get_allocation_box (self, &allocation);
|
||||
|
||||
g_object_get (self,
|
||||
|
Loading…
Reference in New Issue
Block a user