Commit graph

4226 commits

Author SHA1 Message Date
Adrian Johnson
fb2bf3e250 win32-printing: remove unused code 2007-10-21 23:50:57 +09:30
Adrian Johnson
b854d1e1b5 win32-printing: fix typo in comment 2007-10-21 23:50:28 +09:30
Adrian Johnson
2d68c46b77 win32-printing: fix dash-caps-joins test failure 2007-10-21 23:49:58 +09:30
Adrian Johnson
5fa6225045 win32-printing: Add test boilerplate
Testing win32-printing requires setting the default printer to
a PostScript level 3 color printer. The PostScript output is
saved to a file and converted to png using ghostscript.
2007-10-21 23:49:33 +09:30
Adrian Johnson
e63b5e5201 win32-printing: Use the surface ctm in show_glyphs
show_glyphs needs to scale the font by the current CTM.
2007-10-21 23:47:35 +09:30
Adrian Johnson
ac9831ea55 win32-printing: fix stroke rounding problems
The win32 CTM is changed to user space to set the stroke parameters.
As win32 uses integers for stroke parameters this will cause rounding
problems depending on the CTM used.

This is fixed by factoring out a scale from the user space CTM so that
xx, xy, yx, and yy in the CTM are all < 1. This preserves the shape
of the transformation while ensuring that the CTM does not cause
rounding problems. The stroke parameters are multiplied by the scale
value.
2007-10-21 23:46:52 +09:30
Adrian Johnson
89fe7b2ff0 win32-printing: fix rounding problems when using pattern matrix
When using meta surface patterns, the win32 CTM is changed to the
inverted pattern matrix then the meta surface is replayed to the
surface. The problem with this is that win32 uses integer coordinates
for GDI functions. A pattern matrix that scale the CTM up will cause
rounding errors in the position of each path in the pattern.

This is fixed by always keeping the win32 CTM set to the identity
matrix. The CTM is stored in the surface and all coordinates are
transformed by the CTM before calling GDI functions.
2007-10-21 23:45:40 +09:30
Adrian Johnson
af01d9b8fa win32-printing: add meta surface pattern support 2007-10-21 23:43:27 +09:30
Adrian Johnson
dae1b352c6 update cairo-sections.txt 2007-10-21 23:42:54 +09:30
Adrian Johnson
c8da2a7ded win32-printing: check if images are opaque
Don't use fallback for argb32 images with all alpha == 255.
2007-10-21 23:42:22 +09:30
Adrian Johnson
9eb5747755 win32-printing: Add missing struct initializers 2007-10-21 23:41:31 +09:30
Brian Ewins
8f6abdbc26 [quartz] return status instead of CGPatternRef
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error.
2007-10-20 23:41:46 +01:00
Brian Ewins
cfb26fdf0f [quartz] return status instead of cairo_quartz_surface_t
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error.
2007-10-20 23:41:32 +01:00
Brian Ewins
dec3099585 [quartz] return status instead of CGShadingRef
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error. Suggested by Chris Wilson.
2007-10-20 22:45:30 +01:00
Brian Ewins
481ce2b8cb implement clipping with surface masks.
This implements clipping using CGContextClipToMask, which
means that it will only have an effect on OS X 10.4+.
No additional tests pass with this fix - mainly due to
text effects and problems with the IN, OUT, DEST_IN, DEST_ATOP
operators.
2007-10-20 14:06:07 +01:00
Brian Ewins
b9c065df74 fix dash-zero-length test
Quartz was failing the dash-zero-length test for odd numbers
of dashes; it seems cairo wants 3 dashes to be on-off-on,
off-on-off, wheras quartz uses on-off-on, on-off-on. Fixed
by doubling the number of dashes used.
2007-10-20 14:02:19 +01:00
Brian Ewins
f334ee0397 Implement EXTEND_NONE for gradients.
Fixes linear and radial gradients, which were displaying with
extend_pad when extend_none was requested. Makes the
radial-gradient test pass.
2007-10-20 14:02:17 +01:00
Brian Ewins
0eeec372c0 call _cairo_error on failure
Call _cairo_error to enable setting a breakpoint on quartz errors.
2007-10-20 14:02:16 +01:00
Brian Ewins
8c8ec63903 do not return a cairo_status_t of UNSUPPORTED
We had a bug which converted cairo_int_status_t to cairo_status_t,
causing an assertion; reported at http://developer.imendio.com/node/128.
Return the generic out of memory error instead.
2007-10-20 14:02:15 +01:00
Brian Ewins
6fec51990e do not ignore errors, return NULL instead (moz#874315)
In the quartz backend there are occasional errors where returning NULL
can be used to signal that an error has occured.

Mozilla bug #874315.
2007-10-20 14:00:15 +01:00
Brian Ewins
07fd091e3e do not ignore errors in setup_source
In setup_source we were ignoring a return value, but we can't relay
it to the caller. This patch treats the error as an unsupported
operation.
2007-10-20 13:52:09 +01:00
Brian Ewins
b6b9cef713 do not ignore errors when creating styles.
This fixes statuses being ignored when calling
CreateSizedCopyOfStyle. As a side effect, it cleans up
two other bugs - the font object was sometimes not
freed, and a the scaled font mutex was aquired recursively,
causing a hang in the invalid-matrix test.
2007-10-20 13:52:08 +01:00
Brian Ewins
4885a12c68 do not ignore ATSUI errors.
This fixes multiple instances where the return value of an ATSUI
call was ignored and converts them into CAIRO_STATUS_NO_MEMORY.
As a side effect it fixes a utf8 array not being freed.
2007-10-20 13:52:08 +01:00
Brian Ewins
b498c928be do not ignore errors in glyph paths
When interpreting glyph paths in ATSUI callbacks we were ignoring
the cairo status. We need to return this to the caller. In order
to do this we introduce a custom OSStatus code in the range that
Apple reccommend.
2007-10-20 13:52:08 +01:00
Brian Ewins
95c708c717 propagate cairo_status_t return values
There are several places in the quartz surface where we ignored
the returned status. This fixes the simple cases where the error
can just be returned to the caller.
2007-10-20 13:52:08 +01:00
Brian Ewins
7072959e3d Fix to support new similar tests.
The patch to repeat tests for similar surfaces changed the
format of the test log files, which were parsed to produce
index.html. This fixes the parser to understand those changes.
2007-10-20 13:52:08 +01:00
Chris Wilson
ae2535e4cb [cairo-perf] Run performance tests over similar surfaces as well.
Immediately repeat the performance test against a similar surface to
ensure that they introduce no regressions. Primarily introduced to
sanity check the change to use XShmPixmaps instead of XPixmaps in the
xlib backend, but it should be generally useful.
2007-10-20 00:32:00 +01:00
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