Bug 1010 - ClutterLabel does not update the layout (again)
authorNeil Roberts <neil@openedhand.com>
Fri, 12 Sep 2008 10:31:44 +0000 (10:31 +0000)
committerNeil Roberts <neil@openedhand.com>
Fri, 12 Sep 2008 10:31:44 +0000 (10:31 +0000)
commitb16e75db2c51ffddfdcb3ba43aa8f7bf85997904
tree19517d17ba68371d291616167e06c7243850203c
parentb83470366c18149796fc6f682bab2aa100d8c561
Bug 1010 - ClutterLabel does not update the layout (again)

* clutter/clutter-label.c: Bring back layout caching. This time it
will cache up to three different layouts. The width for which each
layout was generated is stored so that if the same width is
requested again it can use the cached version. If no cached
version is available it will try to replace the oldest
layout. 'Age' is determined by a counter which is incremented
every time a layout is created. The cache is cleared after any
property changes that might affect the layout.
(struct _ClutterLabelPrivate): Removed extents_width,
extents_height and context because they weren't used anywhere.

* tests/test-label-cache.c: Add a test which checks whether the
label is using a different layout when properties are
changed. Also compares the extents of the label's layout with an
independent layout and fails if they aren't the same.

* tests/Makefile.am (noinst_PROGRAMS): Add test-label-cache
ChangeLog
clutter/clutter-label.c
tests/Makefile.am
tests/test-label-cache.c [new file with mode: 0644]