Commit graph

4199 commits

Author SHA1 Message Date
Chris Wilson
081507a09e [cairo-test] Repeat tests for similar surfaces.
Having noticed strange discrepancies creeping into similar surfaces
whilst working on the xlib backend, I thought it wise to also run
the test harness against similar targets. For consistency, only
targets whose similar surface use the same backend are included.

This can be disabled by exporting CAIRO_TEST_IGNORE_SIMILAR=1.
2007-10-20 00:15:34 +01:00
Chris Wilson
3211d810d3 [cairo-xlib] Check source for XRender support.
Do not rely on the assumption that if the destination has render support
then the source has it as well - breaks when the boilerplate disables
render support for a surface.

Similarly do not set the XRender attributes on the source surface
unless it actually has a xrender_format.
2007-10-19 23:33:22 +01:00
Chris Wilson
5c08226a0f [cairo-clip] Avoid work when all clipped out.
When the clip mask is empty we perform actions like composite 0x0
surfaces, which results in a lot of unnecessary work and allocations.
Avoid doing work when we know everything is clip out and take the
liberty of freeing any memory associated with the clop state.
2007-10-19 23:33:04 +01:00
Chris Wilson
c70c2cf6d6 [Makefile.am] Fix ${top_srcdir}/libtool
libtool exists in the top level build directory, but in a couple of
places we refer to the top level source directory.
2007-10-19 23:31:36 +01:00
Behdad Esfahbod
76e3b3cdc3 [cairo-xlib] Release glyph surfaces if we made them to be generated
The reasoning is that right now, applications render glyphs to images,
upload it to the X server, and keep a local copy in the cache.  The X
server works hard to reuse glyph renderings, by hashing glyph images and
reusing them.  So we are wasting memory in cairo apps that don't use the
glyph surface after uploading to the server, which is the case if you
don't use the glyph in an image surface.  The patch does not release the
glyph surface if it already existed in the cache, so, worst case
scenario is that we render the glyph twice, if you first use it with
xlib, then with image surface.  That effect should be negligible.
2007-10-19 15:02:03 -04:00
Chris Wilson
8ae7782737 [cairo-xlib-surface] Match content to xrender_format using the channel masks.
_xrender_format_to_content() was using the channel offset to determine
whether the format supported a content type.
For example, the XRenderPictFormat for the A8 format looks like:
    direct.alpha = 0; direct.alphaMask = 0xff;
    direct.red   = 0; direct.redMask   = 0x00;
    direct.green = 0; direct.greenMask = 0x00;
    direct.blue  = 0; direct.blueMask  = 0x00;
which _xrender_format_to_content() matched as CAIRO_CONTENT_COLOR.

Switch to using the channel masks for deducing content type.
2007-10-18 20:09:54 +01:00
Chris Wilson
b7d8763c58 [check-plt] Use -W flag to readelf.
Pass -W to readelf so that the output (in particular the function name)
is not clipped to fit within 80 characters.
2007-10-18 20:09:54 +01:00
Chris Wilson
01eb169773 [test/.gitignore] Add *.exe.so
Ignore these winegcc output files.
2007-10-18 20:09:54 +01:00
Chris Wilson
c64335a9a8 [cairo-scaled-font-subsets] Simplify boolean return code.
_cairo_sub_font_lookup_glyph() was returning either a NULL_POINTER
error or success whereas its only caller was using it as a simple
predicate and handled the 'error' rather than propagate it upwards.
2007-10-18 19:21:35 +01:00
Chris Wilson
379b9b79fa [cairo-xlib] Move the buggy_repeat discovery to the display_t.
The VendorString parsing (to detect broken Xserver versions) was being
performed for each surface creation, but as it is a display invariant
we can save a small amount of work by storing the result on the
cairo_xlib_display_t.
2007-10-18 19:21:01 +01:00
Chris Wilson
5e09653e5d [test/rgb24-ignore-alpha] Destroy the surface after use.
Destroy the surface so that valgrind doesn't complain about the memory
leak.
2007-10-16 16:03:28 +01:00
Chris Wilson
bd3dd72262 [pdiff] Reorganise the inner loops of the convolution.
Reorder the indices and introduce a couple of temporary accumulators to
improve cache access.
2007-10-16 16:03:03 +01:00
Chris Wilson
fa9201b9c9 [pdiff] Check for too small images.
The Laplacian pyramid can only work on images larger than 3x3 due to the
size of its convolution kernel. So if the image is too small return an
error (-1) before attempting to construction the pyramid.
2007-10-16 15:57:44 +01:00
Chris Wilson
3b1cc128dc [cairo-ft-font] Add paranoid error checking to Fc* operations.
Check the return status when using Fc*() functions to modify the pattern
and propagate the failure (if necessary).
2007-10-16 10:56:24 +01:00
Chris Wilson
a55f1abf7c [cairo-clip] Pass the local pattern to create_similar_solid().
Avoid the short-lived pattern allocation within
_cairo_surface_create_similar_solid() by providing the local solid
pattern to use as the source.
2007-10-16 10:42:37 +01:00
Chris Wilson
7ff80234e3 [cairo-path-fixed] Drop the _cairo_error() markup.
Do not use _cairo_error(CAIRO_STATUS_NO_CURRENT_POINT) within
_cairo_path_fixed_get_current_point() as the only caller,
cairo_get_current_point(), expects and handles that status.
2007-10-16 10:42:15 +01:00
Chris Heath
189feaf352 [autogen.sh] Tolerate tput failure (#12757) 2007-10-15 17:31:50 -04:00
Adrian Johnson
4660561cb5 PDF: Add support for CAIRO_FORMAT_A1 images 2007-10-14 19:05:06 +09:30
Adrian Johnson
39044157da PDF: Add support for linear gradients with REPEAT and REFLECT 2007-10-14 19:04:33 +09:30
Adrian Johnson
5af1b2280b Make PostScript output text selectable
The glyph names used in the Type42 and Type1 fallback fonts are now of
the form "/uniXXXX" where XXXX is the unicode character for each
glyph. When converted to pdf (eg using ps2pdf), pdf viewers are now
able to correctly extract the text.
2007-10-14 00:11:57 +09:30
Adrian Johnson
e347a7a7c3 PS: Add support for images with bilevel alpha
This patch eliminates two sources of fallback images. The alpha value
of each pixel in argb32 images are checked. If all alpha values are
255 the image is treated the same as rgb24 images. If all alpha values
are either 0 or 255 and the PS level is 3, a Type 3 image (image +
mask) is emitted.
2007-10-13 22:59:20 +09:30
Adrian Johnson
af5cdde34d PS/Win32-printing: remove redundant checks from _analyze_operation
The check for supported operators is performed earlier in this
functions so these two checks in not required.
2007-10-13 22:15:48 +09:30
Adrian Johnson
ff35ffd2a7 Add meta-surface-pattern test 2007-10-13 22:09:04 +09:30
Adrian Johnson
0b3f530973 Add PS reference images for tests using gradients 2007-10-13 21:49:50 +09:30
Adrian Johnson
e66ce8cbc6 PS: Add linear and radial gradient support 2007-10-13 21:28:19 +09:30
Adrian Johnson
583059e4a3 Fix bug in _gradient_is_opaque() 2007-10-13 21:16:49 +09:30
Adrian Johnson
b5c36010ed Add cairo_ps_surface_restrict_to_level() API 2007-10-13 21:14:28 +09:30
Adrian Johnson
b5fa273c9a Add PS reference images for tests using create_similar
before the PS meta surface pattern patch these tests
had image fallacks in the PS output and did not require
a PS reference image.
2007-10-13 21:04:51 +09:30
Adrian Johnson
8520ce31be PS: Add meta surface pattern support 2007-10-13 20:17:43 +09:30
Chris Wilson
e5b01e6797 [Makefile.am] Add missing headers and reference images.
Andrew Jorgensen spotted that make dist was missing a few headers needed
for compilation and running make distcheck had spurious failures. Add
the missing files to the distribution and a silly one-liner to check for
missing reference images.
2007-10-11 18:05:46 +01:00
Chris Wilson
b7adcf67f8 [cairo-path-stroke] Jump to cleanup after error.
Incorrect early return in _cairo_stroker_curve_to() after
_cairo_stroker_join() resulted in leaking the local spline and pen.
2007-10-11 15:01:14 +01:00
Chris Wilson
0222c02d95 [cairo-pdf-surface] Return UNSUPPORTED from _to_unicode_stream().
Distinguish the UNSUPPORTED case where the font backend does not
support conversion to unicode from other fatal errors by returning a
status value rather than using stream.id == 0 to indicate any error.
2007-10-11 15:00:59 +01:00
Chris Wilson
981bc12e5b [cairo-ps-surface] Close a couple of memory leaks.
Adjust error paths to free local resources.
2007-10-11 15:00:47 +01:00
Chris Wilson
c1db44b265 [cairo-png] Clean up volatile warning.
gcc warns that 'rows' is missing a volatile qualifier - so add it.
2007-10-11 15:00:35 +01:00
Chris Wilson
05702b8b6e [cairo-pdf-surface] Free the clip path on error.
If we fail to add the clip path to the current group, destroy it.
2007-10-11 15:00:22 +01:00
Chris Wilson
8fa5f638a5 [cairo-pdf-surface] Restore old_group for failed emit_meta_surface().
Ensure we restore the surface->current_group if we encounter an error
during _cairo_pdf_surface_emit_meta_surface() lest we leak the
current_group array.
2007-10-11 15:00:13 +01:00
Vladimir Vukicevic
8eb9fcf673 [win32] mask win32 printing vertex colors with 0xff00 per docs
The range for the vertex color structures is 0x0000 .. 0xff00; I
think that this is an error in the docs, but strip out the low bits
just in case.
2007-10-10 14:05:39 -07:00
Vladimir Vukicevic
3545ebc135 Fix win32 printing surface copyright notice
Bad copy-and-paste of license.
2007-10-10 14:05:39 -07:00
Chris Wilson
0b65c301a7 [Makefile.am] Change lcov-clean to use more portable constructs.
Replace xargs and rm with the binaries found by configure and drop the
passing of NUL-terminated strings as that is a GNU extension.
2007-10-10 14:56:52 +01:00
Chris Wilson
b8d7d62b08 Fix some trivial syntax warnings for -ansi.
gcc -ansi -pedantic gives a few syntax warnings, principally for use of
'//' comments and a comma at the end of enumerators. Apply these
corrections as they are trivial.
2007-10-10 14:56:52 +01:00
Chris Wilson
7e6ac74de1 [win32] Clean up compiler warnings.
Fix up a few instances of unused status returns.
2007-10-10 14:24:24 +01:00
Chris Wilson
bee05467a5 [configure.in] Initialise test_svg.
Set test_svg to no prior for checking for SVG availability so that the
printed summary is correct if the user explicitly disables the SVG
surface on the configure command line.
2007-10-10 14:24:12 +01:00
Chris Wilson
785cb5b7e1 [cairo-image-surface] Dead code elimination.
Remove an unreachable return and unused variable - tidy up after
a bad merge.
2007-10-10 14:23:34 +01:00
Chris Wilson
2268c5907c [cairo-glitz-surface] Propagate errors from set_image().
Propagate errors from _cairo_glitz_surface_set_image().
2007-10-10 14:23:10 +01:00
Chris Wilson
4958789b9e [cairo-xlib-surface] Propagate error from _draw_image_surface() to surface.
Instead of simply ignoring the error that may occur when we upload the
destination image to the xlib surface (via XPutImage) record the error
on the xlib surface.
2007-10-10 14:22:49 +01:00
Chris Wilson
9c65efeeb1 [boilerplate-test-surfaces] Check show page for errors.
Check that cairo_surface_show_page() did not generate any errors before
reading back the image buffer and saving it as a png.
2007-10-10 14:22:25 +01:00
Chris Wilson
caf04b1bb8 [cairo-cff-subset] Propagate error status from failed append_copy().
Add a couple of missing status checks for the result of
cff_index_append_copy().
2007-10-10 14:22:13 +01:00
Chris Wilson
ef275cd65a [test-meta-surface] Propagate error from show_page().
Add a missing error propagation for _test_meta_surface_show_page().
2007-10-10 14:22:00 +01:00
Chris Wilson
7758e56d0c [cairo-hull] Remove a couple of redundant status returns.
Those two functions unconditionally returned success, so change the
return to void.
2007-10-10 14:21:51 +01:00
Chris Wilson
1dabfc2b27 [cairo-clip] Propagate error status from clip_intersect_path().
Propagate the error status (filtering out UNSUPPORTED) from
intersect_path() when reapplying the clip path during a deep copy.
2007-10-10 14:21:39 +01:00