Commit graph

4757 commits

Author SHA1 Message Date
Brian Ewins
bb2674207c [quartz] fix leak in show_glyphs
In cairo_quartz_show_glyphs we may leak the source if
there is a failure to malloc the glyph arrays. Fix this.
2007-11-12 23:56:01 +00:00
Brian Ewins
7ad34c1bdc [quartz] fix for cairo_reset_clip() 2007-11-12 23:52:52 +00:00
Brian Ewins
717ccbcf0c Revert "[quartz] handle 0x0 surfaces."
This reverts commit 2fd50a7897.
Spoke too soon, quartz doesn't like creating those 0x0
images; while the tests pass, its putting warnings in the logs.
Reverting to make a better fix.
2007-11-12 23:51:39 +00:00
Brian Ewins
2fd50a7897 [quartz] handle 0x0 surfaces.
Some tests, like invalid-matrix, generate a 0x0 bitmap; in
the quartz backend this caused a nil surface to be returned,
whereas the tests expect a quartz surface. Other surfaces
return a backend-specific surface with a zero-sized bitmap,
quartz should do the same.

Fixes the tests ft-font-create-for-ft-face, get-and-set,
get-clip, invalid-matrix, line-width-zero, 
select-font-no-show-text, solid-pattern-cache-stress,
surface-finish-twice, and text-cache-crash.
2007-11-11 01:49:36 +00:00
Emmanuel Pacaud
0359ad6c8d Compilation warning suppression (char as array subscript).
cairo_path_op_t is a char, and can't be directly used as array subscript.
2007-11-11 00:18:19 +01:00
Emmanuel Pacaud
1b71af7e61 Fix _cairo_path_fixed_init_copy.
All the copied data buffers except the first one weren't completely
initialized (num_ops and num_points). That was the cause of the failure
of some vector surface tests, like random-intersections.
2007-11-11 00:14:34 +01:00
Emmanuel Pacaud
3554c31e3d [SVG] Add missing image to REFERENCE_IMAGES list. 2007-11-10 10:43:43 +01:00
Emmanuel Pacaud
916d82586e [SVG] Indentation fixes. 2007-11-10 10:24:21 +01:00
Emmanuel Pacaud
8edc3ed485 Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2007-11-10 10:10:50 +01:00
Emmanuel Pacaud
3bc8a8d1d0 [SVG] Remove spurious semicolon when emitting mask url. 2007-11-10 10:10:03 +01:00
Emmanuel Pacaud
b68968ffd1 [SVG] Fix opacity of combined stroke and fill.
When emitting combined stroke and fill, cairo SVG backend was using the opacity
two times, instead of using fill-opacity and stroke-opacity, leading to
incorrect output.

I've updated the mask test reference images for the SVG output, since it seems
there's a bug in librsvg when fill-opacity is used in the mask image.
I've checked the SVG output with batik, and it looks fine.
2007-11-10 10:07:12 +01:00
Brian Ewins
77e9b05b2b [test] support using a previous build as a reference
Allow using a previous test output directory as a source of
reference images. To make use of this, set the environment
variable 'CAIRO_REF_DIR' to point at an old test directory,
relative to the current test directory.

This is useful for testing backends when reference images haven't
been created yet, or which the current reference image structure
can't accomodate, like multiple font backends.
2007-11-10 01:34:03 +00:00
Brian Ewins
f8ee0cdf18 [test] Link to the correct reference image.
The generated test html guesses the names of the reference
images used in the tests. This is quite often wrong, and
makes it harder to change policy in cairo-test. Teach
make-html.pl to parse the log for the path to the reference image.
2007-11-10 01:34:01 +00:00
Brian Ewins
15fc1bbefb [test] log tested paths so that they can be parsed.
The test logs currently do not record the paths of
image output, the reference images tested against, and
the diffs created. This means that make-html.pl has to
duplicate the policy in cairo-test.c. Fix this by teaching
cairo-test.c to log the paths.
2007-11-10 01:33:47 +00:00
Vladimir Vukicevic
28412f780e [win32-printing] bail out early if we don't have anything to do in paint_surf 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
d72bb8c12e [win32] Fix FIXED_to_fixed when cairo's fixed format isn't 16.16 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
0901b83ca5 [win32] Don't use GetGlyphOutline on non-TrueType fonts
win32-glyph-metrics.patch: GetGlyphOutline only works on Truetype fonts,
so for non-Truetype fonts, assume no left or right bearing and use the
font ascent and descent for the glyph extents.
2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
f11f7524b6 [quartz] work around Quartz bugs with images bigger than a certain size
Quartz has a bug with images greater than (signed) 16 bits in height; avoid
creating or working with those.  Also fixes some memory leaks.

Patch from John Daggett.
2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
95ede9ea59 Use correct surface resolution when creating paginated fallback image
If a surface resolution is set via _cairo_surface_set_resolution, it
needs to be used when the fallback image is created.  The user sets
the fallback resolution on the paginated surface, so we need
to divide that by the resolution of the actual (target) surface, not
the paginated surface.
2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
9b8d9f2859 [win32] Skip doing some work if we can't call StretchDIBits 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
fa7e36669a [quartz] Fix for 10.5 SDK; the FloatToFixed macro started doing strange things 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
236c52b095 Handle overflow/underflow gracefully when converting to 16.16 fixed 2007-11-09 12:50:45 -08:00
Carl Worth
5b0a0fe7a2 Mention cairo_new_sub_path in documentation of cairo_arc 2007-11-07 11:18:05 -08:00
Chris Wilson
62d64e12aa [cairo-pdf-surface] Create a new path for an empty clip.
If the clip path is empty, then we need to start a new path otherwise
the clip is ineffective.
2007-11-06 15:22:07 +00:00
Chris Wilson
b4057b8643 [cairo-clip] Special case using an empty clip path.
Detect when the user calls cairo_clip() with an empty clip path and
mark the clip as all_clipped.
2007-11-06 15:21:37 +00:00
Chris Wilson
2f0867b43f [cairo-surface] Handle the all clipped out case.
Explicitly handle a clip which represents that the entire surface is
clipped out.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=13084.
2007-11-06 14:26:28 +00:00
Chris Wilson
641215b2b0 [test/clip-all] Combine text and everything clipped out.
https://bugs.freedesktop.org/show_bug.cgi?id=13084 demonstrates a
regression where the clip is ignored by the xlib backend whilst
rendering text. Therefore we extend the current test cases to combine
a clip that represents everything clipped out with the rendering of
text. For completeness, we add a new test case that exactly mimics the
sequence of cairo operations that lead to the discovery of this bug -
namely the rendering of text with an empty clip path.
2007-11-06 13:28:10 +00:00
Behdad Esfahbod
55b530ffef [PS] Fix compiler warnings 2007-11-05 14:47:27 -05:00
Behdad Esfahbod
570714b2b4 [test/fallback-resolution] set tolerance to a large value to see how it performs
in different fallback resolutions.
2007-11-05 13:23:40 -05:00
Behdad Esfahbod
5acbef2021 [test] fallback-resolution: center text 2007-11-05 13:23:35 -05:00
Behdad Esfahbod
7f21bfb0a8 [meta-surface] Adjust tolerance when replaying to surfaces with device scale
such that we get a consistent look with different fallback resolutions.
2007-11-05 13:23:28 -05:00
Richard Hult
4270cd3358 [atsui] Use ascent+descent+leading to get the distance between baselines
The height is currently mapped to the atsui metrics property capHeight, which
is documented as "The height of a capital letter in the font from the baseline
to the top of the letter".

That doesn't match what height is in cairo, it should be the disctance between
baselines. This patch that fixes that (and makes webkit on GTK+ OS X
layout nicely).
2007-11-05 10:05:07 +00:00
Brian Ewins
3141b21c0c [configure.in] fix atsui experimental warning
The 'experimental' warning for atsui was appearing
for --enable-quartz not --enable-atsui as it should.
2007-11-05 10:05:04 +00:00
Chris Wilson
b3ef306f84 [cairo-atomic] Add a few more cpus that are known to have atomic access.
Add x86_64 and arm to the list of cpus which do not require memory
barriers for reading and writing integers/pointers atomically.
2007-11-05 09:09:14 +00:00
Chris Wilson
bd5ed9a398 [cairo-atomic] Declare the mutex for NEEDS_MEMORY_BARRIER.
Whilst NEED_MEMORY_BARRIER should be a subset of ! HAS_ATOMIC_OPS,
until we have accurate configure tests NEED_MEMORY_BARRIER may be
invoked independently.
2007-11-05 09:05:25 +00:00
Chris Wilson
901b0c9752 [cairo-path-fixed] Exponentially enlarge cairo_path_buf_t.
Allocate subsequent path bufs twice as large as the previous buf,
whilst still embedding a small initial buf into cairo_path_fixed_t
that handles the most frequent usage.
2007-11-05 08:51:06 +00:00
Chris Wilson
92a18464ba [cairo-surface] Avoid allocation for common case of 1 box.
_cairo_surface_fill_region(): avoid allocating the array of boxes if we
know that the region only contains one box and is therefore defined by its
extents.
2007-11-05 08:51:06 +00:00
Chris Wilson
e60a7c39cd [cairo-atomic] Check whether we can access int/pointers atomically.
Add a configure check to determine whether the host cpu can read/write
cairo_atomic_t without an explicit memory barrier, and update the macros
within cairo-atomic-private.h to reflect this knowledge.
2007-11-05 08:51:06 +00:00
Adrian Johnson
76667b4c2a ROADMAP: Mark set PS level complete 2007-11-03 16:53:54 +10:30
Chris Wilson
6d2615d449 [test/degenerate-pen] Add missing return value.
Carl - he likes to test us occasionally to make sure we're paying
attention. Well, that's the excuse I use...
2007-11-02 09:17:59 +00:00
Chris Wilson
eb0b16837b [cairo-spline] Eliminate redundant _cairo_fixed_to_double().
Inline and unroll PointDistanceSquaredToSegment() and eliminate the
multiple conversions between fixed point and doubles. This simple
transformation both shrinks the code and wins a few percent in path
intensive benchmarks such as fuckhergently.swf
2007-11-01 22:42:34 +00:00
Chris Wilson
2a25e22658 [cairo-spline] Reduce stack requirements during recursive refinement.
By splitting out the knot vectors into a smaller, separate structure, we
can dramatically reduce the stack allocation for each level of recursion.
Secondly we can have the storage requirements by modifying the first set
of knots in-place, thus we need only allocate stack space for the knots
covering the deferred half of the spline.
2007-11-01 22:27:34 +00:00
Chris Wilson
b311c414a2 [cairo] Use NULL instead of a bare 0.
Silence a sparse warning.
2007-11-01 22:27:19 +00:00
Chris Wilson
fd5c517818 [cairo-scaled-font] Zero extents on early error.
Ensure that the output extents of cairo_scaled_font_glyph_extents(),
are zeroed if we return early due to being passed by the user a
cairo_scaled_font_t with an error set.
2007-11-01 22:27:04 +00:00
Chris Wilson
cee6aa016b [cairo-paginated-surface] Mark the backend static.
Only used within the file, so do not expose outside the library.
2007-11-01 22:26:19 +00:00
Chris Wilson
6e0151df46 [cairo-atomic] Rearrange code under the correct ifdefs.
The atomic get/set depend upon NEED_MEMORY_BARRIER which is separate
from HAVE_ATOMIC_OPS.
2007-11-01 22:26:06 +00:00
Chris Wilson
a26118cf5b [cairo-png] Check for feof whilst reading.
We need to check for both ferror() and feof() when handling short reads.
2007-10-31 21:41:24 +00:00
Chris Wilson
61143e5b21 [cairo-png] Handle missing PNG_SETJMP_SUPPORTED
If libpng has not been compiled with jmpbuf support, then we cannot
atempt to use it - in which case we fall back to png's default error
handler and abort.
2007-10-31 21:41:00 +00:00
Adrian Johnson
c37a8ace81 Round floats in output-stream to 6 significant digits after decimal
The previous commit increased the precision of floats from 6 digits
after the decimal point to 18 digits to correct rounding errors with
very small numbers. However most of the time this extra precision is
not required and results in increased PS/PDF output.

This commit makes the precision after the decimal point 6 significant
digits. For example:

   1.234567
   0.123456
   0.00123456
   0.00000000123456
2007-11-01 00:01:16 +10:30
Behdad Esfahbod
8297daff89 [cairo-output-stream] Write out floats to 18 digits after decimal point
We write floats using %f as the scientific format used by smarter %g is
invalid in PS/PDF.  %f however by default rounds to five digits after
decimal point.  This was causing precision loss and making the newly
added degenerate-pen test fail for PDF.  We now print up to 18 digits
which is as many bits doubles can accomodate.  We can be smarter, but
that's for another commit.
2007-10-31 02:41:33 -04:00