cairo/boilerplate
Chris Wilson aaec63d483 [scaled-font] Global glyph cache
Currently glyphs are cached independently in each font i.e. each font
maintains a cache of up to 256 glyphs, and there can be as many scaled fonts
in use as the application needs and references (we maintain a holdover
cache of 512 scaled fonts as well).

Alternatively, as in this patch, we can maintain a global pool of glyphs
split between all open fonts. This allows a heavily used individual font
to cache more glyphs than we could allow if we used per-font glyph caches,
but at the same time maintains fairness across all fonts (by using random
replacement) and provides a cap on the maximum number of global glyphs.

The glyphs are allocated in pages, which are cached in the global pool.
Using pages means we can exploit spatial locality within the font
(nearby indices are typically used in clusters) to reduce frequency of small
allocations and allow the scaled font to reserve a single MRU page of
glyphs. This caching dramatically reduces the cairo overhead during the
cairo-perf benchmarks, and drastically reduces the number of allocations
made by the application (for example browsing multi-lingual site with
firefox).
2009-01-29 10:10:39 +00:00
..
.gitignore [build] Include all generated win32 build files in the repo 2009-01-09 15:55:24 -05:00
cairo-boilerplate-beos-private.h [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-beos.cpp [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
cairo-boilerplate-directfb-private.h [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-directfb.c [boilerplate/directfb] Create ARGB surfaces on demand. 2008-10-20 23:20:22 +01:00
cairo-boilerplate-getopt.c [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-getopt.h [cairo-boilerplate] Silence compiler warning. 2008-06-13 21:34:43 +01:00
cairo-boilerplate-glitz-agl.c [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
cairo-boilerplate-glitz-glx.c [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
cairo-boilerplate-glitz-private.h [boilerplate] fix compilation for glitz-agl 2008-11-25 20:40:37 +08:00
cairo-boilerplate-glitz-wgl.c [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
cairo-boilerplate-pdf-private.h Automate error checking for fallback-resolution. 2008-09-28 14:57:12 +01:00
cairo-boilerplate-pdf.c [test] Convert a few residual '-out.*' 2008-11-03 14:24:39 +00:00
cairo-boilerplate-ps-private.h Automate error checking for fallback-resolution. 2008-09-28 14:57:12 +01:00
cairo-boilerplate-ps.c [test] Convert a few residual '-out.*' 2008-11-03 14:24:39 +00:00
cairo-boilerplate-quartz-private.h [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-quartz.c [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-scaled-font.h [scaled-font] Get rid of _cairo_scaled_font_test_set_max_glyphs_cached_per_font 2007-04-21 03:43:04 -04:00
cairo-boilerplate-script-private.h Add CairoScript backend. 2008-11-13 11:36:54 +00:00
cairo-boilerplate-script.c Add CairoScript backend. 2008-11-13 11:36:54 +00:00
cairo-boilerplate-sdl-private.h [sdl] Add new backend. 2008-10-30 17:04:53 +00:00
cairo-boilerplate-sdl.c [sdl] Add new backend. 2008-10-30 17:04:53 +00:00
cairo-boilerplate-svg-private.h Automate error checking for fallback-resolution. 2008-09-28 14:57:12 +01:00
cairo-boilerplate-svg.c [test] Convert a few residual '-out.*' 2008-11-03 14:24:39 +00:00
cairo-boilerplate-system.c [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
cairo-boilerplate-system.h [boilerplate] Rename xmalloc.[ch] to boilerplate namespace 2008-09-04 15:53:33 -04:00
cairo-boilerplate-test-surfaces-private.h Automate error checking for fallback-resolution. 2008-09-28 14:57:12 +01:00
cairo-boilerplate-test-surfaces.c Automate error checking for fallback-resolution. 2008-09-28 14:57:12 +01:00
cairo-boilerplate-win32-printing.c [test] Convert a few residual '-out.*' 2008-11-03 14:24:39 +00:00
cairo-boilerplate-win32-private.h Automate error checking for fallback-resolution. 2008-09-28 14:57:12 +01:00
cairo-boilerplate-win32.c [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-xcb-private.h [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-xcb.c [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
cairo-boilerplate-xlib-private.h [test] Preparatory work for running under memfault. 2008-08-13 21:54:59 +01:00
cairo-boilerplate-xlib.c [boilerplate] Redefine DEBUG() for portability concerns 2009-01-03 22:54:14 +00:00
cairo-boilerplate-xlib.h [boilerplate] Add missing headers. Oops! 2007-04-21 07:23:30 -04:00
cairo-boilerplate.c [scaled-font] Global glyph cache 2009-01-29 10:10:39 +00:00
cairo-boilerplate.h [boilerplate] Remove CAIRO_BOILERPLATE_LOG() 2009-01-03 22:56:17 +00:00
check-link.c [boilerplate/check-link.c] Oops. Add it. 2008-09-02 22:03:05 -04:00
Makefile.am [build] Include all generated win32 build files in the repo 2009-01-09 15:55:24 -05:00
Makefile.sources [boilerplate] fix compilation for glitz-agl 2008-11-25 20:40:37 +08:00
Makefile.win32 [boilerplate/Makefile.win32] Only build source files, not headers 2008-10-31 16:45:58 -04:00
Makefile.win32.features [build] Include all generated win32 build files in the repo 2009-01-09 15:55:24 -05:00
README Add boilerplate/README explaining its purpose 2006-08-30 22:33:53 -07:00

This directory provides code that is common to both of cairo's tests
suites:

 * The test suite for correctness in test/
 * The test suite for performance in perf/

We call it boilerplate as it consists primarily of the boilerplate
code necessary for initializing a backend in order to create a surface
for that backend.

The code here just might be useful for someone looking to get started
writing cairo code to use a particular backend, (but there are no
promises that the boilerplate code found here for any particular
backend is exemplary).