mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
83b4ec7a12
When computing the pixels value of a ClutterUnits value we should be caching the value to avoid recomputing for every call of clutter_units_to_pixels(). We already have a flag telling us to return the cached value, but we miss the mechanism to evict the cache whenever the Backend settings affecting the conversion, that is default font and resolution, change. In order to implement the eviction we can use a "serial"; the Backend will have an internal serial field which we retrieve and put inside the ClutterUnits structure (we split one of the two 64 bit padding fields into two 32 bit fields to maintain ABI); every time we call clutter_units_to_pixels() we compare the units serial with that of the Backend; if they match and pixels_set is set to TRUE then we just return the stored pixels value. If the serials do not match then we unset the pixels_set flag and recompute the pixels value. We can verify this by adding a simple test unit checking that by changing the resolution of ClutterBackend we get different pixel values for 1 em. http://bugzilla.openedhand.com/show_bug.cgi?id=1843 |
||
---|---|---|
.. | ||
ADDING_NEW_TESTS | ||
Makefile.am | ||
test-actor-invariants.c | ||
test-actor-size.c | ||
test-anchors.c | ||
test-backface-culling.c | ||
test-binding-pool.c | ||
test-blend-strings.c | ||
test-clutter-fixed.c | ||
test-clutter-rectangle.c | ||
test-clutter-text.c | ||
test-clutter-units.c | ||
test-color.c | ||
test-conform-common.c | ||
test-conform-common.h | ||
test-conform-main.c | ||
test-group.c | ||
test-launcher.sh | ||
test-materials.c | ||
test-model.c | ||
test-npot-texture.c | ||
test-paint-opacity.c | ||
test-path.c | ||
test-pick.c | ||
test-premult.c | ||
test-text-cache.c | ||
test-timeline-interpolate.c | ||
test-timeline-rewind.c | ||
test-timeline.c | ||
test-vertex-buffer-contiguous.c | ||
test-vertex-buffer-interleved.c | ||
test-vertex-buffer-mutability.c |