Add a cache of size requests
authorJohan Bilien <jobi@via.ecp.fr>
Thu, 12 Nov 2009 01:40:57 +0000 (20:40 -0500)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 3 Dec 2009 18:19:50 +0000 (18:19 +0000)
commitc9b7efec96636e9368a8dfb76440d1b89c618c99
tree5d38e35a9bbe96604cddd324ad3a03c3a8e2a50e
parent18860eb16f36eb62b94aee353b4e2ace76e2fffa
Add a cache of size requests

clutter_actor_get_preferred_width/height currently caches only one size
requests, for a given height / width.

It's common for a layout manager to call get_preferred_width with 2
different heights during the same allocation cycle. Typically once in
the size request, once in the allocation. If
clutter_actor_get_preferred_width is called
alternatively with 2 different for_height, the cache is totally
inefficient, and we end up always querying the actor size even
when the actor does not need a re-allocation.

http://bugzilla.openedhand.com/show_bug.cgi?id=1876

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
clutter/clutter-actor.c