Commit graph

721 commits

Author SHA1 Message Date
Carl Worth
13a27d19d4 From: J. Ali Harlow" <ali@avrc.city.ac.uk> Reviewed by: Vladimir Vukicevic <vladimirv@gmail.com>
Update win32 backend to match current API, so it actually builds once again.
2005-06-25 02:00:17 +00:00
Carl Worth
f15ec64e7f Rip out cairo_set_error_notfiy function as it is clear that it is not the right approach.
Remove error-notify test.
2005-06-20 09:59:23 +00:00
Carl Worth
d6eca5a45f Reorder fields of cairo_private_t to match initialization order.
Call error_notify callback if set. (cairo_create): Initialize error_notify callback to NULL. (cairo_set_error_notify): New function to allow the user to set an error notify callback.
New cairo_set_error_notify prototye.
New test for cairo_set_error_notify.
2005-06-16 12:20:46 +00:00
Carl Worth
fac3cd46b3 (cairo_test_for_target): And add missing parenthesis. 2005-06-15 10:58:52 +00:00
Carl Worth
0b122003e7 Track removal of cairo_status_string. 2005-06-15 10:56:31 +00:00
Carl Worth
e749cf524c Remove cairo-atsui section since cairo-atsui.h is currently empty. Add cairo_path_data_type_t and cairo_path_data_t.
Add pdf-clip and pdf-clip.pdf.
2005-06-15 10:41:41 +00:00
Kristian Høgsberg
476fe9a66e Implement path clipping and refactor _cairo_gstate_clip() out in three different functions corresponding to the three different clipping modes.
Add NULL pointers for intersect_clip_path.
New test case to exercise PDF clipping code.
2005-06-14 19:45:22 +00:00
Owen Taylor
23976d00b2 Add
-I$(top_builddir)/src for cairo-features.h (Tomasz Cholewo)
2005-06-09 07:26:40 +00:00
Kristian Høgsberg
7b4a65dba4 When clipping, update the clip surface to a new surface the size of the intersection of the old clip surface and the extents of the new clip path. 2005-06-03 16:40:15 +00:00
Carl Worth
707a2c97a1 Add self-intersecting to the list of expected failures. 2005-06-01 13:10:57 +00:00
Carl Worth
48fbc201c7 Add self-intersecting test which demonstrates the long-standing bug with stroking self-intersecting paths. 2005-06-01 11:03:50 +00:00
Keith Packard
45a966f695 Replace nesting-only surface clipping with gstate contained serial-number tracked clipping sets that are loaded into the surface on demand just before each rendering operation. This permits multiple cairo_t contexts to reference a surface without regard to ordering of operations among the contexts.
Also in this patch is a change to the xlib surface that creates two separate Pictures, one for source and one for destination operands which separates the source clipping from destination clipping. Cairo now specifies that sources are never clipped by any clipping applied to them as destinations.
Move cairo_clip_t (renamed from cairo_clip_rec_t) from cairoint.h to cairo-gstate-private.h. Eliminate stack of clip state from surfaces. Add new surface clipping API.
Manage clip objects entirely within the gstate, loading the whole thing into the surface just before drawing.
Source surfaces need not have clipping modified as the surface interface now specifies that source surfaces are always unclipped.
Eliminate nested clipping contexts, leaving clip management entirely to the gstate. Create new clip API for the gstate which uses per-surface serial numbers to match gstate clipping against current surface clipping values.
Surfaces no longer track clipping regions at all, so the old _cairo_surface_get_clip_extents has been replaced with _cairo_surface_get_extents. For PDF/PS surfaces, this function is expected to return a rectangle covering the entire fixed point coordinate space to leave rendering unclipped by the surface.
Region clipping capability is now signalled by a non-NULL function pointer in set_clip_region.
Each surface now contains two Pictures, one for source and one for destination operands so that source operands are never clipped by destination clipping.
CAIRO_STATUS_BAD_NESTING removed
self-copy now passes (Xlib only, until libpixman changes land)
reviewed by: krh, otaylor, cworth
2005-05-26 11:35:44 +00:00
Carl Worth
ec84ace5a6 Update instructions to match output of 'make distcheck'
Add private headers and flesh out CLEANFILES so that 'make distcheck' actually passes.
2005-05-17 09:08:23 +00:00
Carl Worth
30d7ede3df Update cairo-xcb.h to provide the same style of interface as cairo-xlib.h.
Update to match new cairo_xcb_surface_t create functions.
2005-05-17 06:11:32 +00:00
Carl Worth
0c05b23b31 Rework of cairo_xlib_surface create functions by Keith Packard:
Add cairo_xlib_surface_create_with_render_format.
Reduce Xlib constructors down to two simple forms. Add width, height to constructors and eliminate any synchronous size queries from the implementation.
Update to match new cairo_xlib_surface_t create functions.
2005-05-17 06:05:13 +00:00
Carl Worth
84bc5a32d6 Remove destroy_closure from cairo_output_stream_t interface.
Remove destroy_closure argument from cairo_pdf_surface_create_for_stream. Rename width,height to width_in_points, height_in_points for better clarity.
Brush a bunch of dust off of the PS backend and bring it up to date with the latest API conventions from the PDF backend. These include: accepting a filename rather than a FILE in the primary constructor, providing a stream-based interface for more flexibility, and accepting a surface size in device-space units (points) rather than inches.
Make it a little more clear that the width and height being passed around are in units of points.
Update to the latest cairo-ps.h changes as described above. Notice how much more sane things become now that the surface size is described in device-space units.
2005-05-17 05:58:01 +00:00
Carl Worth
9bf26e8e73 Add simple test for ps surface backend (modeled after pdf-surface.c).
Add print message telling user to examine resulting file.
2005-05-17 01:05:35 +00:00
Carl Worth
189161118f Update PDF test case to make sure we're actually getting the right paper size, image scaling etc. And it should now be easier to see if cairo is happy by manually viewing the resulting PDF file. 2005-05-17 00:54:09 +00:00
Carl Worth
91dcaea6a2 Update to the latest PDF surface API changes: use filename not FILE* and use surface dimension in points, not inches. 2005-05-17 00:34:10 +00:00
Carl Worth
e5b31bca7c Remove quarter-over test name accidentally added to Makefile. 2005-05-16 15:05:56 +00:00
Carl Worth
60b0a05df7 Brush the dust off the XCB backend and get it compiling and working again. This patch makes the XCB surface API match that of the Xlib surface API as of yesterday. But, it's already stale as the Xlib API changed again. So we'll need one more revision of the XCB backend before the next snapshot.
Add support for testing of the xcb backend as well.
2005-05-14 14:01:46 +00:00
Carl Worth
6a1af1999d Cleanup output a bit, move verbose messages to test-specific log file. 2005-05-14 13:51:59 +00:00
Carl Worth
55366995b6 Fix a few documentation typos in the recent xlib surface rework. 2005-05-14 10:15:11 +00:00
Carl Worth
f797eaac1c Update for change in cairo_pdf_surface_create which no longer accepts DPI values. 2005-05-14 10:00:27 +00:00
Owen Taylor
bef4b13716 src/cairo-xlib-surface.c src/cairo-xlib.h doc/public/cairo-sections.txt: Drop the _for_pixmap() and _for_window() out of the create functions and use some lazy cleverness to sniff the information out as needed.
src/cairo-xlib-surface.c src/cairo-xlib-test.h Makefile.am: add cairo_test_xlib_disable_render() to turn off RENDER for tests.
Test various different types of Xlib surface creation.
Remove left-over include of Xrender.h.
2005-05-13 17:54:43 +00:00
Carl Worth
27d9c575a7 Add new test for bug in cairo_paint_with_alpha not transforming the source.
Use a transformed copy of the source just like we do in all the other calls to cairo_surface_composite. Fixes the bug tested by test/paint-with-alpha.
2005-05-12 11:02:35 +00:00
T Rowley
b913a81c34 Revive quartz backend.
Set fill type repeat on source surface. (_cairo_glitz_surface_show_glyphs): Add missing cairo operator to glitz operator conversion. (_cairo_glitz_surface_show_glyphs): Only render glyphs with non zero size.
Fix bounding box computation.
2005-05-11 16:01:56 +00:00
Carl Worth
b05c85eafb Removing mucking around with stderr and add a cairo_test_log function instead.
Switch all error messages from fprintf(stderr,...) to cairo_test_log(...).
2005-05-10 20:25:38 +00:00
Carl Worth
3253534a82 Don't guess and make our own definitions for uint8_t, etc. Just error out if we can't find a suitable header file.
Fix to use fixed-size type so that this code works when sizeof(unsigned long) != 32. Thanks to Manish Singh.
2005-05-10 12:42:32 +00:00
Carl Worth
10c88d4244 Change definitions of everything in cairo-features.h to prefer #if over #ifdef.
Track #ifdef -> #if changes.
Add support to automatically change all #ifdef CAIRO_HAS to #if CAIRO_HAS.
2005-05-06 21:33:22 +00:00
Carl Worth
4fff218fc4 Update to track new CAIRO_OPERATOR names.
Fix documentation to refer to functions by their current names.
Update to track latest API (in currently unused function).
2005-05-06 21:19:49 +00:00
Carl Worth
d7fe527e0f Eliminate the following deprecated functions from cairo's interface:
cairo_copy cairo_get_path cairo_get_path_flat cairo_matrix_create cairo_matrix_destroy cairo_matrix_copy cairo_matrix_get_affine cairo_surface_set_repeat cairo_surface_set_matrix cairo_surface_get_matrix cairo_surface_set_filter cairo_surface_get_filter
Also, eliminate all support for compiling against, or running with old, deprecated names for functions.
Deal with all of the removals.
2005-05-06 13:32:53 +00:00
Carl Worth
a790a2ea79 Rename and re-order the cairo_operator_t enum to names that abbreviate less and are easier to understand, (eg. CAIRO_OPERATOR_DEST_OVER instead of CAIRO_OPEERATOR_OVER_REVERSE). 2005-05-06 13:26:16 +00:00
Carl Worth
d6fc5ee5e9 Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create.
Port to use new cairo_create interface.
Rewrite all tests that were using cairo_set_target_surface to instead create a temporary cairo_t, (eventually to be replaced with cairo_begin_group).
2005-05-06 13:23:41 +00:00
Owen Taylor
cea1de7579 src/cairo.[ch] doc/public/cairo-sections.txt: Add cairo_paint_with_alpha().
Fix segfault when mask == NULL.
test/mask.c test/mask-ref.png: Add testing of cairo_paint_with_alpha().
test/coverage.c test/coverage-ref.png: Remove ... it's not testing anything that mask doesn't test better.
2005-05-06 12:00:22 +00:00
Carl Worth
05ccd76854 Originally 2005-04-20 Carl Worth <cworth@cworth.org>
Remove cairo_show_surface. Add new cairo_set_source_surface.
Remove _cairo_gstate_show_surface.
Replace calls to cairo_show_surface with cairo_set_source_surface; cairo_paint.
Fix messages to prefer - over _.
Fix documentation.
Three new tests to exercise set_source_surface more completely, (two of these are expected failures dues to outstanding bugs).
2005-05-03 08:33:32 +00:00
Owen Taylor
7dbd1f4401 src/cairo-surface.c src/cairoint.h: Add _cairo_surface_begin/end to save and restore the clip state of a surface. Copy and store clip regions set on a surface so that we can save and restore them.
Add a CAIRO_STATUS_BAD_NESTING error for interleaved use of two cairo_t's on the same surface. Also, add a skeleton doc comment for cairo_status_t.
src/cairo.c src/cairo-gstate.c src/cairoint.h: Use _cairo_surface_begin/end to replace _cairo_gstate_restore_external_state.
Use _cairo_surface_begin/end to save the state of a surface when we start drawing at it and restore it at the end. Check that the save level of the surface is what we expect on drawing operations and fail with CAIRO_STATUS_BAD_NESTING otherwise.
src/cairo-pattern.c src/cairoint.h (_cairo_pattern_acquire_surface_for_surface) (_cairo_pattern_release_surface): Surround use of pattern->surface with _cairo_surface->begin/end so we don't clip surfaces used as sources.
test/clip-nesting.c test/Makefile.am: Test of destinatin clipping with the nested creation of cairo_t's for the same context.
test/source-clip.c test/Makefile.am: Test that clipping on a source as a destination doesn't affect use of it as a source.
XFAIL test for copying from a surface as a source to itself as a destination with a clip.
2005-05-02 13:39:30 +00:00
Keith Packard
4ce3d3fb26 Use correct arguments to compute absolute positions.
Test cairo_rel_move_to, cairo_rel_line_to and cairo_rel_curve_to
reviewed by: cworth
2005-05-02 12:36:20 +00:00
Owen Taylor
1464e35fde not mask.png. (Pointed out by Carl) 2005-05-02 11:42:41 +00:00
Owen Taylor
79b2a79f2d src/cairo.[ch] src/cairo-gstate.c: Add cairo_mask() and cairo_mask_surface().
test/maks.c tests/Makefile.am tests/mask-ref.png: Add a comprehensive tests for cairo_mask().
Updated
2005-05-02 11:01:18 +00:00
Carl Worth
2a6e7ef7c3 Replace annoying _ in output image filenames with - for better consistency. 2005-04-28 11:15:47 +00:00
Carl Worth
f3bc5e5554 Use 1 instead of 0 for width and height to avoid BadValue errors from XCreatePixmap. 2005-04-27 14:09:41 +00:00
Carl Worth
2f5b0808b8 Add support for testing multiple backends, courtesy of cairo_surface_write_to_png. Currently, only image and xlib backends are fullk hooked-up, but other backends should be quite easy to add for anyone skilled in the appropriate art. 2005-04-27 13:33:25 +00:00
Carl Worth
1c316ca07a Add test to demonstrate bug in cairo_paint when under a non-identity transformation. 2005-04-26 18:56:37 +00:00
Carl Worth
1baa4d1329 Originally: 2005-04-19 Carl Worth <cworth@cworth.org>
Add cairo_stroke_preserve, cairo_fill_preserve, and cairo_clip_preserve.
Rip the path out of cairo_gstate_t.
Add path to cairo_t.
Bring in most of the path code that used to live in cairo-gstate.c
Move arc generation code into its own file.
Accept path+ctm_inverse+tolerance instead of gstate. Absorb flattening and device space->user space conversion that used to be in _cairo_gstate_intepret_path.
Prefer cairo_fixed_t parameters over ciaro_point_t for cross-file interfaces.
Track changes in _cairo_path_fixed interfaces.
Port to use cairo_fill_preserve rather than cairo_save/cairo_restore which no longer work for saving the path.
Remove get and set of current point since it is no longer affected by cairo_save and cairo_restore. Add get and set testing for cairo_matrix_t.
2005-04-26 12:38:06 +00:00
Carl Worth
618792c8c0 Add very simple test to generate PDF output, (no automated verification yet).
Track PNG interface changes, (no more include of cairo-png.h, cairo_surface_write_png renamed to cairo_surface_write_to_png).
2005-04-26 09:43:39 +00:00
Kristian Høgsberg
87009d692b Factor out bulk of the code into a new callback based function, write_png(). Call it with a stdio write callback. (cairo_surface_write_png_to_stream): New function to write a surface to a PNG stream. (cairo_image_surface_create_from_png): Likewise, move most of the code to read_png(), clean up error handling and reduce this function to calling read_png() with a stdio based read function. (cairo_image_surface_create_from_png_stream): New function to create an image surface from a PNG stream.
New functions to get widht and height of an image surface.
Add new prototype and error codes.
Adjust to new PNG API.
2005-04-25 20:42:54 +00:00
Carl Worth
9c10b54e5e Add new cairo_paint function.
Add new get_extents function to the surface backend interface.
Add function to query current clip_extents.
Implement the new get_extents function for each backend.
Save the clip extents from set_clip_region and implement _cairo_surface_get_clip_extents.
Abstract away the evil XGetGeometry roundtrip in _cairo_xlib_surface_get_size.
Rewrite a couple of tests to call cairo_paint.
2005-04-19 16:29:04 +00:00
Carl Worth
f13b13a70e Add a test of a repeating surface pattern. 2005-04-18 16:26:14 +00:00
Carl Worth
aef8f9b1a0 Mark a couple of items that are now complete.
Add test case that fills and strokes the same shapes, (in preparation for testing cairo_fill_preserve patch).
2005-04-18 05:25:57 +00:00