Commit graph

4529 commits

Author SHA1 Message Date
Carl Worth
55e0dddf04 Add cairo_path_extents testing to several cases missing it
With these degenerate shapes, cairo_path_extents still returns
a zero-area rectangle, but with a non-zero offset.
2008-01-21 14:45:06 -08:00
Carl Worth
63df3a82a3 Fix cairo_path_extents to ignore lone cairo_move_to points.
Update the documentation as well.
2008-01-21 13:47:05 -08:00
Carl Worth
c15cab8b68 Correct near-pangram to be an actual pangram
This wasn't affecting the test quality at all, but it did annoy
me to see this mistake.
2008-01-21 13:34:53 -08:00
Carl Worth
ed695bdb9b Define repeated string literal once 2008-01-21 13:33:46 -08:00
Carl Worth
80df194b77 Clarify documentation of cairo_{fill,stroke,path}_extents
Mostly just adding more cross-references between the documentation
of these three similar functions.
2008-01-21 12:14:49 -08:00
Brian Ewins
eba04b7fbc [path] use new interpret_flat infrastructure for path_populate
refactor to reduce duplication of flattening code.
2008-01-21 12:07:11 -08:00
Brian Ewins
3270ae6a65 [path] Use new interpret_flat infrastructure for path_count.
Refactor to reduce duplication of path flattening code.
2008-01-21 12:06:36 -08:00
Brian Ewins
4177208be6 [cairo] Add cairo_path_extents()
This new function gets the extents of the current path, whether
or not they would be inked by a 'fill'. It differs from
cairo_fill_extents() when the area enclosed by the path is 0.

Includes documentation and updated test.
2008-01-21 12:04:32 -08:00
Brian Ewins
d923457c0f [path-fixed] make _cairo_path_fixed_bounds use _cairo_path_fixed_interpret_flat
_cairo_path_fixed_bounds can use the new _interpret_flat mechanism; this
results in tighter bounds; previously the bounds followed the control
points of the beziers, whereas now they are the bounds of the curve.
2008-01-21 12:01:44 -08:00
Brian Ewins
1471b3f00a [path-fixed] add _cairo_path_fixed_interpret_flat
_cairo_path_fixed_interpret_flat flattens the path as it
interprets it, meaning that a curve_to callback is not
required.
2008-01-21 12:01:44 -08:00
Behdad Esfahbod
3339c32b0a [cairoint.h] Move MSC inline macros into cairo-compiler-private.h
where they belong
2008-01-20 02:56:26 -05:00
Behdad Esfahbod
ac17ce0f89 [cairo-fixed/wideint-private.h] Split out typedefs from prototypes
such that the type definitions can be used from boilerplate without exposing
the prototypes.
2008-01-20 02:55:07 -05:00
Peter Weilbacher
f072d815d4 [cairo-ft] Fix typo in comment 2008-01-19 20:54:25 -05:00
Peter Weilbacher
0fb800ff22 [cairo-ft] Add FC_PIXEL_SIZE as double, not int 2008-01-19 20:54:24 -05:00
Adrian Johnson
8887fb3593 Fix PS/PDF Type 1 font embedding when glyph 0 is used
cairo-scaled-fonts-subsets.c reserves position 0 in each subset for
glyph 0 (.notdef) as the font embedding of each font type requires
.notdef as the first glyph. For some reason this was done by reserving
the position then inserting glyph 0 in the collect function instead of
just adding the glyph to the hash table when the subset is
created. The problem this caused was that when an application called
show_glyphs() with glyph 0, the glyph was added to the hash table
(because it was not already there) resulting in two .notdef glyphs in
the subset. This resulted in breakage in the Type 1 subsetting where
the second .notdef was not emitted and all subsequent glyphs were
moved up one place resulting in incorrect font encoding in the PS/PDF
output.

Fix this by adding .notdef to the subset hash table when the subset is
created.

This fixes #13841.
2008-01-20 01:33:56 +10:30
Adrian Johnson
574bdd01fd Type1-subset: Add newline to the end of the font
as some fonts do not have a newline at the end of the last line
2008-01-20 00:26:09 +10:30
Adrian Johnson
ec272fbd09 Fix PDF extend-reflect test failure
Previously, when emitting image patterns the PDF backend used
_cairo_pattern_acquire_surface to get the image. For reflected images
this would return an image containing four images in a reflect
pattern.  When drawn in a PDF pattern (which only does repeating
patterns) this would create the reflected pattern in PDF.

For some reason _cairo_pattern_acquire_surface is no longer returning
a reflected image pattern.

This is fixed by only using _cairo_surface_acquire_source_image to get
the image and using the same code as is used for reflected
meta-surface patterns to created a reflected pattern by drawing four
transformed copies of the image inside the PDF patten.

This is the better way to implement reflected images as we are no
longer embedding an image four times larger than the original.
2008-01-19 12:46:24 +10:30
Carl Worth
50d0767c8b Add a1-image-sample and a1-traps-sample tests
Both of these currently fail due to bugs in the way pixman does
its sampling.
2008-01-18 12:41:57 -08:00
Carl Worth
c11790fded Quiet a warning about switch without some cairo_surface_type_t enum values 2008-01-18 11:17:37 -08:00
Carl Worth
1d6c2d578f Remove some gratuitous assert statements
Calling assert immediately after assigning a literal value is
very bad form.
2008-01-18 11:17:37 -08:00
Adrian Johnson
eabd28a655 win32-printing: define GRADIENT_FILL_RECT_H bug #14107
Older versions of mingw do not define this.
2008-01-18 21:53:04 +10:30
Chris Wilson
0086db893c [cairo-font-options] Treat NULL as a default cairo_font_options_t
Interpret a NULL cairo_font_options_t as the default values - i.e
as if it were a fresh pointer returned by cairo_font_options_create().
2008-01-17 22:38:02 +00:00
Chris Wilson
02d0e07063 [cairo-font-options] Use cairo_font_options_status() rather open-coding.
By switching to cairo_font_options_status() instead of checking against
the _cairo_font_options_nil error object, the API is protected from NULL
dereferences.
2008-01-17 21:40:51 +00:00
Chris Wilson
b15e91d2b6 [cairo-font-options] Check for a NULL cairo_font_options_t
On IRC Drakou reported a user error whereby cairo_scaled_font_create()
was called with a NULL cairo_font_options_t. However, instead of
reporting the error back to the user, cairo instead segfaulted trying
to dereference the NULL pointer!

Add a guard to check that the options is not NULL.
2008-01-17 21:11:00 +00:00
Chris Wilson
630536f176 [test/extend-*] Add various cairo_pattern_set_extend() test cases.
Add various test cases to exercise
_cairo_pattern_acquire_surface_for_surface(), most notably using similar
source surfaces to provide coverage of the non-image surface branch.
2008-01-17 17:45:17 +00:00
Chris Wilson
dec2daeaf3 [cairo-{ps,pdf}-surface] Assert the font is supported during emission.
Add an ASSERT_NOT_REACHED to the tail of the font subset emission
functions - as they should always, at least, be supported by the
fallbacks.
2008-01-17 15:34:51 +00:00
Chris Wilson
bde68fd4d6 [cairo-scaled-font] Propagate the error to the font.
If we encounter an error whilst using the font backend to convert the
text to the glyphs, flag the scaled font with that error.
2008-01-17 15:08:16 +00:00
Chris Wilson
d664e3253e [cairo-scaled-font] Typo.
s/ZERO_EXENTS/ZERO_EXTENTS/
2008-01-17 15:05:10 +00:00
Chris Wilson
fcdc525dde [cairo-xlib] Remove the NULL safeguards.
No need to guarding against the pointer being NULL on internal functions
as no path can call the function will a NULL pointer and no path should
ever try, which in any case it would be better to crash immediately.
2008-01-17 14:51:22 +00:00
Chris Wilson
7b1a0eddac [test/get-path-extents] Exercise cairo_scaled_font_text_extents()
Compare cairo_scaled_font_text_extents() to cairo_text_extents() in
order to provide test coverage of cairo_scaled_font_text_extents().
2008-01-17 13:51:21 +00:00
Chris Wilson
dbc97c2576 [text] Set the extents on the error paths.
Ensure the text extents are initialized (zeroed) if we encounter an
error along for any of the text extents functions.
2008-01-17 13:41:19 +00:00
Chris Wilson
aec7ae67aa [test/text-zero-len] Test the public cairo_scaled_font_* with NULLs.
Pass NULL to cairo_scaled_font_(text|glyph)_extents() to test the
consistency of the extents API.
2008-01-17 13:32:04 +00:00
Chris Wilson
390e22894b [test/in-fill-trapezoid] Add a few holes.
Complete the coverage of _cairo_trap_contains() by cutting holes out of
the simple shapes.
2008-01-17 13:13:40 +00:00
Chris Wilson
da9c43329a [test/in-fill-trapezoid] Add test to exercise _cairo_trap_contains().
A simple test to provide coverage of _cairo_trap_contains(), though
not yet seeking boundary conditions.
2008-01-17 11:50:51 +00:00
Chris Wilson
f638e5ea35 [cairo-region] Review status propagation.
Check that the error status is propagated from _cairo_region_*.
2008-01-17 11:50:51 +00:00
Chris Wilson
248f0060e5 [cairo-analysis-surface] Return the nil surface rather than NULL.
On error return a nil surface that represents the error rather than
making the assumption of a NO_MEMORY error in the caller.
2008-01-17 11:50:51 +00:00
Chris Wilson
dd13a00541 [test/get-path-extents] Check extents of degenerate paths.
Ensure that degenerate paths have zero extents.
2008-01-17 11:50:32 +00:00
Chris Wilson
3f202c081d [Makefile.am] Another path massage for lcov.
Beware the inline functions in the headers that are now being pulled
into the boilerplate code.
2008-01-16 23:42:24 +00:00
Chris Wilson
9ebfa8b5fb [Makefile.am] Couple check-ref-missing into release-check
Verify that all the reference images checked into git will be included
within the distribution tarball as early as possible in the release
process.
2008-01-16 23:30:15 +00:00
Chris Wilson
f9a80c06b4 [cairo-path-stroke] Convert degenerate splines into lines.
This fixes a discrepancy in the stoker between splines and lines,
whereby the stroker failed to add a dash for a zero length spline.
2008-01-16 23:28:27 +00:00
Chris Wilson
2621a323a0 [test/dash-curve] Add a new test case for dashes along splines.
Modify the dash-state test case and use curves instead of lines -
exercises _cairo_stroker_curve_to_dashed() and degenerate splines.
2008-01-16 23:24:41 +00:00
Chris Wilson
bb41fa22e3 [Makefile.am] Further massage lcov paths for srcdir != builddir.
The lcov scripts generate incorrect absolute paths to the builddir for
source files - so convert them to srcdir using sed.
2008-01-16 23:21:53 +00:00
Carl Worth
0a4ced5a26 Increment version to 1.5.7 after the 1.5.6 snapshot 2008-01-16 10:47:46 -08:00
Carl Worth
d2a02d4f5c Remove check-has-hidden-symbols.i on 'make distclean'
Without this, 'make distcheck' fails so releases don't happen.
2008-01-16 10:36:01 -08:00
Carl Worth
5c3a0b5c00 Add miter-precision-ref.png tothe distribution. 2008-01-16 10:22:44 -08:00
Carl Worth
cb1ddc4e47 Replace -I($builddir) with -I. to avoid breaking non-srcdir builds.
This variable was expanding to an empty string, so the next -I flag
was getting completely swallowed. Let's avoid being clever and just
use . which is what we want in the expansion anyway.
2008-01-16 10:15:34 -08:00
Carl Worth
ad8d03967a Increment version to 1.5.6 and to 15:0:13 2008-01-16 09:48:54 -08:00
Carl Worth
fe27f4b9a3 NEWS: Add notes for cairo 1.5.6 2008-01-16 09:48:54 -08:00
Chris Wilson
1bccbd88c3 [cairo-pdf-surface] Review error propagation from output stream.
Ensure that errors encountered whilst processing the output stream are
propagated back to the surface (and the user).
2008-01-16 17:02:52 +00:00
Chris Wilson
20151fc534 [cairo-ps-surface] Review error propagation during surface creation.
Track the error during surface creation so that it can be returned to
the user via _cairo_surface_create_in_error().
2008-01-16 17:01:03 +00:00