Commit graph

4398 commits

Author SHA1 Message Date
Vladimir Vukicevic
552cf1dbd3 Fix cairo_surface_fallback_snapshot's use of release_source_image
&image_extra was being passed instead of image_extra to release; the
bug only manifested itself when the particular backend did something
with image_extra.
2008-01-04 16:19:14 -08:00
Keith Packard
81e029edda Add new miter-precision test. Checks miter joins at many scales.
This demonstrates an error in cairo where miter joins are replaced with
bevels at high scale factors due to a test added to eliminate wild miters
drawn when the line faces are nearly parallel.
2008-01-03 18:24:24 -08:00
Chris Wilson
b796a2f69d [cairo] Update CAIRO_STATUS_LAST_STATUS
A couple of new errors have been added without updating the LAST_STATUS
value...
2008-01-03 23:00:27 +00:00
Chris Wilson
c67d99787c [test/surface-pattern-big-scaled-down] Kill the surface leaks.
Destroy the surface and pattern after use.
2008-01-03 18:01:43 +00:00
Chris Wilson
6a7a07adf9 [test] Update distribution list of ref images.
Add missing *-ps-rgb24-ref.png images, and a couple of tests to .gitignore.
2008-01-03 17:35:06 +00:00
Chris Wilson
399f7c24e3 [cairo-pdf-surface] Continue to close streams even after error.
Do not return after encountering the first error whilst closing streams,
but continue to close any auxiliary streams before finally reporting the
error. Also during finalize check that we have closed any streams that
may have been left open after encountering an error.
2008-01-03 17:34:58 +00:00
Chris Wilson
42e77c1077 [cairo-pdf-surface] Destroy closed streams.
Destroy the streams when closing groups in order to free the associated
resources.
2008-01-03 17:34:47 +00:00
Chris Wilson
42bfe370f8 [cairo-pdf-surface] Propagate error from emit_glyph().
Propagate the error and return early rather than setting the error on
the surface and continuing.
2008-01-03 17:34:38 +00:00
Chris Wilson
2a8e80f59e [cairo-gstate] Rearrange invalid-matrix guards.
Test for an invalid matrix before use. Whilst this has no effect on the
result, an INVALID_MATRIX error will be raised on the context, placing
the guards first makes the code obviously safe and avoids manipulation
of invalid matrices.
2008-01-03 11:03:17 +00:00
Chris Wilson
e89cc8fa15 [cairo-scaled-fonts-subsets] Memleak and error reporting.
Fix leaks of strings and hash table from
_cairo_scaled_font_subset_create_glyph_names().

Whilst we are in the vicinity, review the error handling.
2008-01-03 11:03:17 +00:00
Chris Wilson
51f37995c9 Remove cairo_private from *.c files.
The cairo_private markup is only required in the headers, so cleanup the
couple of remaining occurrences in the source files.
2008-01-03 11:03:17 +00:00
Chris Wilson
48fd65cdb5 [cairo-svg-surface] Propagate the original error status.
Return the error status from the paginated surface instead of
hard-coding a bare CAIRO_STATUS_NO_MEMORY.
2008-01-03 11:03:17 +00:00
Chris Wilson
ba392488cb [cairo-ps-surface] Wrap error site with _cairo_error().
Wrap the original allocation error site with _cairo_error().
2008-01-03 11:03:17 +00:00
Chris Wilson
4442acc966 [cairo-atsui-font] Minor _cairo_error() tidy.
Inline the use of _cairo_error() for slightly improved readability.
2008-01-03 11:03:17 +00:00
Chris Wilson
2a0267639a [cairo-ps-surface] Wrap error site with _cairo_error().
Markup the original error site for CAIRO_STATUS_TEMP_FILE_ERROR with
_cairo_error().
2008-01-03 11:03:17 +00:00
Chris Wilson
cc5bd47255 [cairo-svg-surface] Wrap a couple of error sites with _cairo_error().
Wrap a couple of bare CAIRO_STATUS_NO_MEMORY with a call to
_cairo_error().
2008-01-03 11:03:17 +00:00
Chris Wilson
daf77ed3cb [cairo-type1-subset] Remove the unused return value.
Nobody actually used the index returned by
cairo_type1_font_subset_use_glyph(), so remove it.
2008-01-03 11:03:17 +00:00
Chris Wilson
fd8bf67853 [cairo-truetype-subset] Propagate error from failing to allocate padding.
Before filling the padding, check that we have successfully allocated
the buffer - otherwise propagate the failure.
2008-01-03 11:03:17 +00:00
Claudio Ciccani
ad0a2524ff [cairo-directfb] Optimize blend functions in fill_rectangles(), too. 2008-01-02 15:09:58 +01:00
Adrian Johnson
060f384310 Fix PS/PDF meta surface patterns
This was failing with more than one level of push/pop group.  The
problem was that the meta surface replay in PS/PDF emit_meta_surface
was replaying all the meta surface commands insteads of only the
natively supported commands. The analysis surface has also been
changed to replay meta surface patterns back to the one analysis
surface instead of creating a separate analysis surface for each
pattern. The analysis surface now transforms bounding boxes with the
meta surface pattern matrix so that fallback regions are correctly
tracked.
2007-12-29 00:26:11 +10:30
Adrian Johnson
4fa46e3caa Implement a win32 tmpfile() function
Bug report and proposed patch at:
http://lists.cairographics.org/archives/cairo/2007-December/012529.html

On Windows the tmpfile() function creates the file in the root
directory. This will fail if the user does not have write access to the
root directory.

Implement _cairo_win32_tmpfile() that is #defined as tmpfile() on
Windows. This function uses GetTempPath() and GetTempFileName() to
create the temporary file. CreateFile() is used to open the file so
the DELETE_ON_CLOSE flag can be set.
2007-12-29 00:25:34 +10:30
Adrian Johnson
dcacad9323 PS: Use _TEMP_FILE_ERROR for temp file errors 2007-12-29 00:13:24 +10:30
Adrian Johnson
bd44d114a6 Add CAIRO_STATUS_TEMP_FILE_ERROR 2007-12-29 00:12:44 +10:30
Chris Wilson
e82b0f46b2 [cairo-path-fixed] Consolidate cairo_path_buf_t when copying.
When copying the cairo_path_fixed_t, consolidate the list of
dynamically allocated cairo_path_buf_t into a single buffer.
2007-12-27 12:55:50 +00:00
Chris Wilson
e0187ad49b [cairo-path-fixed] Ensure the points array is naturally aligned, take 2.
By enlarging buf_size to ensure the correct alignment of the points
array with the cairo_path_buf_t block, we can efficiently use the
padding bytes to store more ops.
2007-12-27 12:46:24 +00:00
Chris Wilson
d8169b8cef [cairo-path-fixed] Ensure the array of points is correctly aligned.
In http://bugs.gentoo.org/show_bug.cgi?id=203282, it was identified that
the cairo_path_buf was causing unaligned accesses (thus generating SIGBUS
on architectures like the SPARC) to its array of points. As we manually
allocate a single block of memory for the cairo_path_buf_t and its
arrays, we must also manually ensure correct alignment - as opposed to
cairo_path_buf_fixed_t for which the compiler automatically aligns the
embedded arrays.
2007-12-27 10:45:25 +00:00
Chris Wilson
7f69c2588b [cairo-ps-surface] Missing status checks.
Check and propagate the error status.
2007-12-20 21:30:22 +00:00
Chris Wilson
51523aec81 [cairo-meta-surface] Remove redundant _cairo_error().
Remove the _cairo_error() from the return, as it has already been called
immediately after the error was first detected.
2007-12-20 21:22:03 +00:00
Chris Wilson
146484e312 [valgrind] Update zlib suppressions.
Match the zlib library as found on hardy+dbgsym.
2007-12-20 21:21:54 +00:00
Chris Wilson
d4d3873bcc [cairo] Correct the documentation for cairo_get_group_target().
cairo_get_group_target() can never return NULL, but will always
return the current destination surface.
2007-12-20 21:21:46 +00:00
Chris Wilson
3bf06c3366 [test/*] Create new surfaces using the group target.
cairo_get_target() returns the original surface passed to
cairo_create(), and not the current destination as required when
testing drawing to the same surface using multiple contexts.

For completeness we also use the group target when creating similar
surfaces within the tests (to check that similar surfaces of similar
surfaces also work).
2007-12-20 21:21:32 +00:00
Chris Wilson
643834e7aa [cairo-surface] Return UNSUPPORTED for acquire_(dest|source)_image.
If the backend does not support fallbacks ie backend->acquire_dest_image
or backend->acquire_source_image is NULL, then return
CAIRO_INT_STATUS_UNSUPPORTED rather than attempt to jump to the NULL
hooks.
2007-12-20 17:51:56 +00:00
Chris Wilson
14454e12d8 [cairo-test] Wrap test function with cairo_save/restore().
Restore the context to the original state before blitting the
group surface in order to remove any residual state such as a clip path.
2007-12-20 17:51:56 +00:00
Behdad Esfahbod
d0119a5aa2 [cairo-unicode] Don't compile _cairo_utf8_to_utf16 on Linux
The _cairo_utf8_to_utf16() is only used in win32 and atsui font backends.
Don't build it if none of those two are available.
2007-12-20 12:30:35 -05:00
Chris Wilson
281b11aef1 [cairo-test] Use CAIRO_OPERATOR_SOURCE when painting the group surface.
To correctly copy a surface onto the destination irrespective of its
content requires the SOURCE operator. Forgetting to do so here causes
uninitialized pixels to be mixed into the result and the failure of
many tests for the similar surface. Oops...
2007-12-20 17:12:08 +00:00
Chris Wilson
ed3fccec01 [pdiff] Avoid the memleak for small surfaces.
Allocate the arrays after the guard against small surfaces to avoid
leaking them.
2007-12-20 14:13:12 +00:00
Chris Wilson
df938a515b [cairo-path-bounds] Check for the empty path.
Avoid returning uninitialized variables if we're asked to find the
bounds of an empty path - in which case we just return a rectangle
of zero width and height similar to the empty clip region.
2007-12-20 14:13:12 +00:00
Jim Meyering
c2adfb4052 Don't leak memory upon failed realloc.
* cairo-glitz-surface.c (_cairo_glitz_surface_composite_trapezoids):

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-12-19 11:09:47 -08:00
Behdad Esfahbod
4595134598 [directfb] Fix header include order to include cairoint.h first 2007-12-18 16:00:21 -05:00
Nis Martensen
18f4f02f72 [src/check-cairoint.sh] Fix typo in shell script 2007-12-18 15:59:19 -05:00
Chris Wilson
8343d6cc2a Replace various uses of CAIRO_STACK_BUF_SIZE with a single macro.
In http://bugs.freedesktop.org/show_bug.cgi?id=13699, Pavel Vozenilek
reports a duplicate define for computing the appropriate length for an
on-stack array. The macro in question, and a few other places, was
performing CAIRO_STACK_BUF_SIZE/sizeof(stack[0]) so we can simplify
them slightly by using a common macro.
2007-12-17 13:45:01 +00:00
Benjamin Otte
627a8b4a2f [directfb] replace u32 with uint32_t
This fix makes it compile for me again
2007-12-17 12:42:14 +01:00
Behdad Esfahbod
9637ffc62f [cairo-xlib] Minor cleanup and add comment 2007-12-17 01:55:15 -05:00
Behdad Esfahbod
83963d2a9e [cairo-ft] Revert "Force non-AA text when using a bitmap strike with only scaling transform." (#13479)
The reasoning for that commit was that fonts with bitmap strikes should be
rendered with antialiasing off for those (hopefully) few glyphs that don't
have a bitmap.

However, it turns out, there are fonts that have some, but very few, bitmaps,
and this changed forces non-AA rendering on them.  We now support multiple
glyph formats per font in the Xlib backend, so backing this out to let every
glyph render as is.  Fontconfig rules can be used to force AA off on a per-font
basis.

This reverts commit 06af5c2891.
2007-12-17 01:19:53 -05:00
Behdad Esfahbod
805b668260 [cairo-xlib] Support scale fonts with glyphs of multiple formats (#13479)
We maintain three Xrender glyphsets per scaled font, one for each of A1, A8,
and ARGB32.  This is required to correctly support fonts with bitmaps for
some glyphs but not all.
2007-12-17 01:14:45 -05:00
Carl Worth
f6dd037cf3 Remove rasterization when a paginated surace is used as a source
This was an old workaround for a bug that seems to no longer
exist. Thanks to Donn Ingle for pointing out the problem.
2007-12-14 14:04:13 -08:00
Adrian Johnson
9b3ce8b17a PS: Use the correct bounding box in Type 3 fonts
Previously this was a fixed size.
2007-12-12 23:41:53 +10:30
Adrian Johnson
afdd53d35f PS: Return the status for emit_image and gradients 2007-12-12 23:35:56 +10:30
Boying Lu
55f5c4ffda Remove cairo_private from static declaration 2007-12-12 21:05:57 +10:30
Claudio Ciccani
942e3d5308 [cairo-directfb] Support some environment variables
Added a couple of (boolean) env. vars affecting the backend:
CAIRO_DIRECTFB_NO_ACCEL, disables acceleration
CAIRO_DIRECTFB_ARGB_FONT, enables using ARGB fonts instead of A8
2007-12-11 15:50:05 +01:00