Commit graph

6718 commits

Author SHA1 Message Date
Chris Wilson
ee7ac5681f [path] A degenerate curve_to becomes a line_to.
Be consistent.
2009-01-29 10:10:39 +00:00
Chris Wilson
778ced4879 [path] Rename _cairo_path_fixed_approximate_extents()
Rename approximate_extents() to approximate_clip_extents() so that it is
consistent with the fill and stroke variants and clearer under what
circumstances you may wish to use it.
2009-01-29 10:10:39 +00:00
Chris Wilson
75f7c420b6 [perf] Remove a redundant clear during source init.
After a short wild goose chase to see why
cairo_image_surface_fill_rectangles() was appearing in the profile,
tweak init_and_set_source_surface() to remove the redundant clear and
to propagate any errors in the auxiliary context.
2009-01-29 10:10:38 +00:00
Chris Wilson
706f6de68d [perf] Add another variation on the many-rectangles case
This variation aims to show the difference between calling fill once
per-rectangle, or once for all rectangles.
2009-01-29 10:10:38 +00:00
Chris Wilson
ff5d37a8ad [mutex] Civilise the comment.
Note bene that Behdad does not like people shouting.
2009-01-29 10:10:38 +00:00
Jeff Muizelaar
f4ff6128d7 Avoid "empty body in an if-statement" warning
Use '(void)expr;' instead of 'if (expr) ;' to avoid getting the warning.
'if (expr) {}' is an option, however '(void)expr;' seems like a more common
idiom and getting warnings for __attribute__((warn_unsed_result)) functions is
probably prefered.
2009-01-28 17:16:32 -05:00
Adrian Johnson
41feeedcc1 Use PS font name in PS TrueType fonts 2009-01-22 23:12:14 +11:00
Adrian Johnson
b7a9e1d4ac Embed full font name in PDF TrueType and CFF fonts
if the full font name was available in the font.
2009-01-22 23:12:14 +11:00
Adrian Johnson
6f2db9a4b0 Use PS font name in CFF and TrueType PDF font subsets
James Cloos found that the font name in embedded fonts should be the
PostScript font name (nameID=6 in the name table).

http://lists.cairographics.org/archives/cairo/2008-December/015919.html
2009-01-22 23:12:14 +11:00
Adrian Johnson
2ed08f7801 Factor out duplicate code in truetype and cff subsetting
The code for reading the font name from the name table has been moved
to a new function: _cairo_truetype_read_font_name().
2009-01-22 23:12:14 +11:00
Adrian Johnson
1deb1e4510 PDF: Include subset tag in font name
PDF requires font names of subsetted fonts to be preprended with
"XXXXXX+" where XXXXXX is a sequence of 6 uppercase letters unique the
font and the set of glyphs in the subset.
2009-01-22 23:12:14 +11:00
Carl Worth
c4e54629bb Add details to test/COPYING about license of bundled fonts.
Just the public-doamin 6x13.pcf file for now, but Adrian will
be bundling more soon.
2009-01-22 12:26:55 +11:00
Chris Wilson
6801f28f6d [perf] Add a utility to compare backends.
A minor variation on cairo-perf-diff-files that compares tests with the
same name for multiple backends.
2009-01-14 16:51:09 +00:00
Chris Wilson
4c79cd480d [perf] Tweak dragon to hit fill_rectangles().
Add a second dragon path that is pixel-aligned and uses a solid pattern,
so that it can be drawn using fill-rectangles.
2009-01-14 16:51:09 +00:00
Chris Wilson
de9e6b5a3f [perf] Cover linear gradient with 3 stops.
The i915 is able to special case gradients with just 2 color stops to
avoid creating temporary gradient textures, so add a 3 stop linear
gradient to compare the speed difference.
2009-01-14 16:51:09 +00:00
Chris Wilson
7cbc55f216 [perf] Add scaled similar surface sources.
Cover the similar source with min/mag scale factors as well, so we can
compare the performance impact with scaled image sources. This is useful
to distinguish between transport overhead and transform cost.
2009-01-14 16:51:09 +00:00
Chris Wilson
afce1cfe98 [scaled-font] Avoid repeated lookup of the same unicode during text->glyphs
Performing the unicode to index is quite expensive, the
FcFreeTypeCharIndex() taking over 12% in the cairo-perf text benchmarks.
By adding a simple cache of translated unicode indices, we save around 25%
of the lookups during benchmarks, with a relative reduction in runtime.
2009-01-14 16:51:08 +00:00
Chris Wilson
49eca78a42 [test] Add a huge-radial test case.
Also test the handling of radial gradients with large radii.
2009-01-14 16:51:08 +00:00
Chris Wilson
7709d1d9d4 [test] Add fill-image.
A filled equivalent of stroke-image, that checks that the pattern
matrices are applied correctly during fills - useful with the
segregation between fills and strokes introduced by spans.
2009-01-14 16:51:08 +00:00
Chris Wilson
5605e4bfcd [test] Propagate failure from painting large-source-roi
Use cairo_get_target() to propagate any failure when creating the
large-source.
2009-01-14 16:51:08 +00:00
Behdad Esfahbod
59a14f6223 Comment win32 maintainer-clean files again 2009-01-10 13:09:06 -05:00
Søren Sandmann Pedersen
cc51191739 Uncomment win32 maintainer-clean files to make Makefile.am syntactically correct 2009-01-10 12:13:40 -05:00
Behdad Esfahbod
06deaa98b6 [build] Include all generated win32 build files in the repo
So a git clone can be built on win32.  The files only change after adding
new backends.
2009-01-09 15:55:24 -05:00
M Joonas Pihlaja
8157bc8a2d [test] Stress test using large source images.
This test attempts to trigger failures in those backend clone_similar
methods that have size restrictions on the resulting image.  It also
triggers errors in scaling down large image surfaces as the image
backend also fails this test.
2009-01-04 04:14:28 +02:00
Chris Wilson
388ae177e4 [boilerplate] Remove CAIRO_BOILERPLATE_LOG()
The variadic macro is only used within boilerplate/ so replace it with a
simple, and portable, call to fprintf.
2009-01-03 22:56:17 +00:00
Chris Wilson
5f816ccd25 [boilerplate] Redefine DEBUG() for portability concerns
Behdad warned that using an empty variadic macro was non-portable.
2009-01-03 22:54:14 +00:00
Chris Wilson
acb2717372 [quartz] Define RTLD_DEFAULT
RTLD_DEFAULT is a gnu-ism (at least according to the manpage on my linux
system) so declare _GNU_SOURCE before including dlfcn.h and failing that
provide our own definition.
2009-01-03 21:53:15 +00:00
Chris Wilson
ff1f5de551 [boilerplate] Suppress xlib warnings on stderr
If we cannot test the xlib backend simply because there is no Display,
just report UNTESTED and do not clutter the output with superfluous
warnings [see the output from the buildbots for an example]. However,
keep the warnings around so that a developer can re-enable them
and so simply move them to a new "lower priority" macro.
2009-01-03 21:53:09 +00:00
Chris Wilson
75538962c8 [boilerplate] Check the return of pclose()
pclose() returns the child exit status, so we can use that to detect
errors in the convertor process.
2009-01-03 21:52:58 +00:00
Chris Wilson
333158ec85 [configure] Replace awk comparator with an aclocal version
As reported in https://bugs.freedesktop.org/show_bug.cgi?id=19283, the
fallback freetype version compare is broken inside the configure script as
the $1-$3 arguments are interpreted as the script is constructed. To avoid
making that awk comparison any more complicated, we import a version compare
from the autoconf archives - such that we have a reusable macro for the
furture.
2009-01-02 15:44:52 +00:00
Chris Wilson
dc33ae2461 [boilerplate] Use pclose() after popen
Joonas pointed out that we should be using pclose() on a stream returned
by popen().
2009-01-02 15:44:52 +00:00
Chris Wilson
f230ce7658 [path] Fix typo in bounds for empty path.
We set the width to be zero, twice, and the height not even once!
2009-01-02 15:44:51 +00:00
Chris Wilson
163c326c82 [test] Free test name
Adding the missing free for the converted test name.
2009-01-02 15:44:51 +00:00
Chris Wilson
dd65be740c [test/pdf-mime-data] Free data on error paths.
Cleanup the allocated buffers on error.
2009-01-02 15:44:51 +00:00
Chris Wilson
65f9760d66 [toy-font-face] Return defaults for error objects.
Similar to the behaviour of the other objects, we return the default
conditions if the object is in any error (and not just a nil object).
2009-01-02 15:44:50 +00:00
Behdad Esfahbod
d478d5ed5c [doc] Give a small hint about Twin font
Though, the details are not documented yet.  I'm not sure how much of it
I do want to document.
2009-01-02 06:51:15 -05:00
Chris Wilson
a023104400 [trace] Adopt _cairo_dtostr
In order to have locale-independent output of decimal values, we need to
manually transform such numbers into strings. As this is a solved problem
for cairo, we adopt _cairo_output_stream_printf() and in particular the
_cairo_dtostr() routine for our own printf processing.
2009-01-02 10:36:52 +00:00
Chris Wilson
c601f30843 [cairo] Early return if we attempt to set the same colour.
Profiling a silly video renderer that called set-source; rectangle; fill;
for each pixel, we can shave 5% off the cairo overhead by introducing an
early return if we attempt to reset the current colour.
2009-01-02 09:53:27 +00:00
Chris Wilson
fb3522f33a [os2] Fix memory leak of surface on error path
Of we fail to create the mutex, free the surface before returning the
failure.

Reported: http://bugs.freedesktop.org/show_bug.cgi?id=19208.
2009-01-02 09:53:27 +00:00
Chris Wilson
8d23c3a6c2 [quartz] Delay allocation of string until after guard.
Fixes a memory leak should we bail due to the version of Quartz being
insufficient.

Reported: http://bugs.freedesktop.org/show_bug.cgi?id=19209.
2009-01-02 09:53:27 +00:00
Chris Wilson
9c9ed8f0b5 [scaled-font] Post-process hash value.
Mix the bits within the hash value to reduce clustering.
2009-01-02 09:53:26 +00:00
Chris Wilson
555dd6b97e [scaled-font] Switch to a constant loop for hashing.
As we only use the FNV hash for hashing matrices, expose the constant size
to the compiler so that it can perform its magic.
2009-01-02 09:53:26 +00:00
Chris Wilson
f5274f5847 Iterate over hash table using foreach() in destructors.
Don't use the remarkably inefficient _cairo_hash_table_random_entry() to
remove all entries from the hash table!
2009-01-02 09:53:26 +00:00
Chris Wilson
1c4ea84b24 [cairo] Early return if we attempt to set the same scaled_font
If the application calls cairo_set_scaled_font() with the current
scaled font, we can return early as it is a no-op.
2009-01-02 09:53:26 +00:00
Chris Wilson
b661f3d27b [cairo] Embed a second gstate.
Experiment with embedding a second gstate into the initial context to
reduce allocations.
2009-01-02 09:53:25 +00:00
Chris Wilson
8abd21bd3a [script] Call the context creation hook
Hook in the creation hook so applications can record or even modify the
contexts used in replay.
2009-01-02 09:53:25 +00:00
Chris Wilson
2c9323d394 [script] more targets 2009-01-02 09:53:25 +00:00
Chris Wilson
fd96cea4fe [script] Improve array construction.
Limit the memory allocation to the initial array size and perform a direct
copy from the operand stack to the array.
2009-01-02 09:53:24 +00:00
Chris Wilson
ecb8dce27c [script] Recreate surface content.
Use the content recorded in the trace, defaulting to COLOR_ALPHA, to
determine the replayed surface type.
2009-01-02 09:53:24 +00:00
Chris Wilson
d21529b9ef [trace] Correct escaped characters in string literal.
Laziness caused the control character to be used instead of its
replacement in the escaped string!
2009-01-02 09:53:24 +00:00