diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-09-21 12:52:49 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-09-21 12:57:27 +0900 |
commit | ca251cf1d45ed6be71065d058313b9b22d36f10d (patch) | |
tree | 2f7e29336c5d101ae327ec4ec4219f6e6686e6d2 /gtk/gtkprivate.h | |
parent | 6ba904486ce6f3c2e6f8d95288c9b66ce29f4ce3 (diff) | |
download | gtk+-ca251cf1d45ed6be71065d058313b9b22d36f10d.tar.gz |
Reduced overall SizeRequestCache size
This patch changes the 'age' counting previous approach taken
verbatim from clutter and changes it for a counter of validated
caches and an index to the last cached value which we use to
round-robin through the cache if ever a widget is requested
for more than 3 contextual sizes (cache is reduced by 3 * sizeof (int)
per widget private data).
Diffstat (limited to 'gtk/gtkprivate.h')
-rw-r--r-- | gtk/gtkprivate.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/gtkprivate.h b/gtk/gtkprivate.h index 9e5b4cf141..8fa1c9b9f0 100644 --- a/gtk/gtkprivate.h +++ b/gtk/gtkprivate.h @@ -117,12 +117,13 @@ gboolean _gtk_fnmatch (const char *pattern, /* With GtkSizeRequest, a widget may be requested * its width for 2 or maximum 3 heights in one resize + * (Note this define is limited by the bitfield sizes + * defined on the SizeRequestCache structure). */ #define GTK_SIZE_REQUEST_CACHED_SIZES 3 typedef struct { - guint age; gint for_size; gint minimum_size; gint natural_size; @@ -131,8 +132,10 @@ typedef struct typedef struct { SizeRequest widths[GTK_SIZE_REQUEST_CACHED_SIZES]; SizeRequest heights[GTK_SIZE_REQUEST_CACHED_SIZES]; - guint8 cached_width_age; - guint8 cached_height_age; + guint cached_widths : 2; + guint cached_heights : 2; + guint last_cached_width : 2; + guint last_cached_height : 2; } SizeRequestCache; |