summaryrefslogtreecommitdiff
path: root/src/cairo-cache-private.h
Commit message (Collapse)AuthorAgeFilesLines
* Use uintptr_t for all casts between pointer and integerAdrian Johnson2021-07-251-1/+1
| | | | | | | | | | | | On 64-bit windows, long is 32-bit. When compiling there are a large number of warnings about mismatched sizes when casting long to/from a pointer. Use the (u)intptr_t type for any integer that will have a pointer stored in it. Use a (u)intptr_t cast when integers are stored in pointers to silence warnings. Fixes #263
* Fix warnings from check-doc-syntax.shUli Schlachter2014-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | $ ./check-doc-syntax.sh Checking documentation for incorrect syntax ./cairo-types-private.h (148): WARNING: cairo_hash_entry_t: missing 'Since' field (is it a private type?) ./cairo-types-private.h (161): WARNING: cairo_hash_entry_t: not found ./cairo-types-private.h (175): WARNING: cairo_lcd_filter_t: missing 'Since' field (is it a private type?) ./cairo-cache-private.h (85): WARNING: cairo_cache_entry_t: missing 'Since' field (is it a private type?) ./cairo-region.c (857): WARNING: cairo_region_overlap_t: not found ./cairo-raster-source-pattern.c (62): WARNING: SECTION:cairo-raster-source 'Since' field in non-public element The warnings about missing 'Since' fields are fixed by changing the documentation comment so that the script can see that these are private types. The documentation for cairo_region_overlap_t gets moved to cairo.h, just like e.g. the documentation for cairo_status_t. The 'Since' field from the SECTION:cairo-raster-source is removed, because this kind of field is needed on the individual functions and structs, not on the section. Thanks to Bryce Harrington for bringing this up! Signed-off-by: Uli Schlachter <psychon@znc.in> Tested-by: Bryce Harrington <b.harrington@samsung.com>
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* [cache] Expose init/fini methods so that caches can be embedded.Chris Wilson2009-06-011-6/+21
| | | | | | The structure is already exposed, so just expose the constructors/destructors in order to enable caches to be embedded and remove a superfluous malloc.
* [scaled-font] Lean and mean global glyph cache.Chris Wilson2009-03-161-4/+1
| | | | | | | | | | | | | | | | | | | | | | | Jeff Muizelaar pointed out that the severe overallocation implicit in the current version of the glyph cache is obnoxious and prevents him from accepting the trunk into Mozilla. Jeff captured a trace of scaled font and glyph usage during a tp run and presented his analysis in http://lists.cairographics.org/archives/cairo/2009-March/016706.html Using that data, the design was changed to allocate pages of glyphs from a capped global pool but with per-font hash tables. This should allow the glyph cache to have tight memory bounds with fair allocation according to usage. Note that both the old design and the 1.8 glyph cache had essentially unbounded memory constraints, since each scaled font could cache up to 256 glyphs (1.8) or had a reserved page (old), with no limit on the number of active fonts. Currently the eviction policy is a simple random strategy, this gives a 'fair' allotment of the cache, but a LRU variant might perform better. On a sample run of firefox-3.0.7 perusing BBC news in 32 languages: 1.8: cache allocation 8190x, ~1.2 MiB; elapsed 88.2s old: cache allocation 771x, ~13.8 MiB; elapsed 81.7s lean: cache allocation 433x, ~1.8 MiB; elapsed 82.4s
* [scaled-font] Global glyph cacheChris Wilson2009-01-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | 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).
* Add CairoScript backend.Chris Wilson2008-11-131-1/+1
| | | | | | | | | | A new meta-surface backend for serialising drawing operations to a CairoScript file. The principal use (as currently envisaged) is to provide a round-trip testing mechanism for CairoScript - i.e. we can generate script files for every test in the suite and check that we can replay them with perfect fidelity. (Obviously this does not provide complete coverage of CairoScript's syntax, but should give reasonable coverage over the operators.)
* [hash] Return lookup entry.Chris Wilson2008-11-071-3/+2
| | | | | | | Use the return value to return the result from _cairo_hash_table_lookup() (as opposed to filling an output parameter on the stack) as this (a) results in cleaner code (no strict-alias breaking pointer casts), (b) produces a smaller binary and (c) is measurably faster.
* [doc] Stricter syntax check for type names, update testBehdad Esfahbod2008-01-281-1/+1
|
* [doc] Make sure all function names in docs are followed by ()Behdad Esfahbod2008-01-281-2/+2
|
* [doc] Make sure all type names in docs are prefixed by #Behdad Esfahbod2008-01-281-2/+2
|
* Move GCC attributes wrapping into a separate header.Chris Wilson2007-09-251-0/+1
| | | | | | | The wrapping of GCC attributes (such as cairo_private) needs to be visible to any header file, including those that avoid cairoint.h such as cairo-boilerplate. To achieve this we move the pre-processor magic to its own header file and include it as required.
* Remove include of cairoint.h from *-private.h header files.Carl Worth2007-08-231-1/+0
| | | | | | | | | | | | These were recently added, (as part of sparse integration?), but they break boilerplate which reaches into at least cairo-types-private.h and cairo-scaled-font-private.h. But boilerplate cannot see cairoint.h or else it gets the internal sybol renaming, (with the INT_ prefix), and then all the test suite tests refuse to link. If this change reverts some recently-added functionality, (or cleanliness), then we'll just need to find some other way to add that back again without the breakage.
* [Makefile.am] Add target sparse to run sparse static source code analyzerBehdad Esfahbod2007-08-221-0/+1
| | | | There are still some bits not quite working.
* Move cairo_cache_t to cairo-types-private.hBehdad Esfahbod2007-04-211-1/+1
|
* Make all hash/cache keys_equal function accept const pointers.Carl Worth2006-03-221-1/+1
|
* Originally 2005-09-06 Carl Worth <cworth@cworth.org>:Carl Worth2005-09-121-6/+2
| | | | | | | _cairo_cache_preserve -> _cairo_cache_freeze _cairo_cache_release -> _cairo_cache_thaw Track rename of _cairo_cache_freeze/thaw. Track rename. Add stacking behavior to _cairo_cache_freeze/thaw. Abstract out shrinking from _cairo_cache_insert so that _cairo_cache_thaw will also shrink as necessary. Make this function static since its current limitation to accept an entry rather than a key makes it not as externally useful as would be desirable. Document this limitation.
* Clean up some documentation issues pointed out by otaylor.Carl Worth2005-09-021-6/+4
|
* Split out scaled font code to cairo-scaled-font.cKeith Packard2005-08-311-0/+131
Replace cairo cache implementation (this code from cworth) No more global glyph cache to clean up Store glyphs in new per-scaled font caches which hold user-space metrics and device space bounding boxes Refactor glyph drawing APIs so that the surface API is invoked directly from the gstate code. Add path creation/destruction routines (to hold glyph paths) New implementation of scaled fonts which uses per-scaled_font caches for glyphs and keeps user-space metrics, device-space bboxes along with glyph images and/or glyph paths. Adapt to new scaled font API changes. New cache and scaled_font APIs Repond to bug fix in metrics computation for glyphs where y values were rounded up instead of down because of a sign difference between cairo and FreeType. Reviewed by: otaylor, cworth