From 1a1e7d35730b510f2a32e25bb34ae7ab0e2be349 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 16 Apr 2010 11:11:50 +0100 Subject: [PATCH] text: Increase the size of the Layout cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, each ClutterText caches 3 Pango layouts: » one for the preferred, unbounded width » one for the preferred height for a given width » one for the allocated size Some layout managers do a double pass that could flush the whole cache before it has a chance of actually storing relevant data, resulting in a continuous series of misses. We can try to counteract this by doubling the size of the cache, from three slots to six. More than six would be pointless, as well as too memory consuming; but we might get down to a number between 3 and 6 at any later point. --- clutter/clutter-text.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 3dce675a1..27fa41912 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -66,8 +66,11 @@ * the preferred width to get the preferred height and then it might * be regenerated at a different width to get the height for the * actual allocated width + * + * since we might get multiple queries from layout managers doing a + * double-pass allocations, like tabular ones, we should use 6 slots */ -#define N_CACHED_LAYOUTS 3 +#define N_CACHED_LAYOUTS 6 #define CLUTTER_TEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_TEXT, ClutterTextPrivate))