Commit graph

860 commits

Author SHA1 Message Date
Carl Worth
7bb6dfdaa2 Add new function cairo_status_to_string an reimplement cairo_status_string in terms of the new function. 2005-05-31 16:05:06 +00:00
Olivier Andrieu
63428d3cc7 : Fix memory leak 2005-05-26 17:35:35 +00:00
Keith Packard
ae96f5db6c Split clipping into separate source and destination operand clips. By default, source operands are not affected by any client clipping. This matches the desired semantics for cairo. When this code is ported back to the X server, that will have to select the clipping option which clip source operands to the client clip. 2005-05-26 13:02:31 +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
Olivier Andrieu
be903f4c22 trivial doc fixes. 2005-05-26 03:31:28 +00:00
Carl Worth
17a5c3a3da Re-synch with latest from gtk-doc CVS tree.
Add --only-section-tmpl option so that changes to inline documentation does not lead to churn in the .sgml template files.
Commit new templates now that gtk-doc has ripped all the inline portions out.
New template files added for new sections.
Update to match current API.
Make parameter names match those in the .c file and its documentation.
2005-05-24 16:08:39 +00:00
Carl Worth
d41465d89a Protect less-than and greater-than symbols in documentation string. 2005-05-22 11:12:46 +00:00
Carl Worth
e90a5c8990 Not that a patch has been submitted for consistent error handling.
Fix documentation string for cairo_create so that it might actualyl appear in the manual.
2005-05-22 09:08:23 +00:00
Carl Worth
b16dafe553 Add -head to CAIRO_VERSION after tagging with SNAPSHOT_0_1_5. 2005-05-18 10:23:48 +00:00
Carl Worth
17c740eb6b Add notes for snapshot 0.1.5.
Increment version to 0.1.5.
2005-05-18 10:13:14 +00:00
Carl Worth
b1301f4013 Add -head to CAIRO_VERSION after tagging with SNAPSHOT_0_5_0. 2005-05-18 09:41:47 +00:00
Carl Worth
f083b21c76 Clear pointers to NULL after destroying/freeing them. 2005-05-18 09:27:24 +00:00
Carl Worth
55a7bb718f Declare pixman_fixed16_16_t properly as int32_t rather than just int. Reported by Lance Fetters. 2005-05-18 09:25:54 +00:00
Carl Worth
f030aec810 Added porting guide to help with transition to cairo 0.5 API.
Added notes for snapshot 0.5.0
Increment CAIRO_VERSION to 0.5.0
2005-05-17 18:39:56 +00:00
Carl Worth
3f9573b7bb Bring up to date with Keith's latest improvements to cairo-xlib-surface.c: Add some comments about how and why masks are computed. Generalize overflow detection in mask computation. Expand on pixman format conversion comment. Fix the broken visual->format case. 2005-05-17 15:23:53 +00:00
Carl Worth
f0923288c5 Two fixes from Kristion Høgsberg:
Fix to close the file if we opened it.
Grab the status from out of the stream _before_ we destroy the stream.
2005-05-17 12:40:55 +00:00
Keith Packard
b4710711b8 Add some comments about how and why masks are computed. Generalize overflow detection in mask computation. Expand on pixman format conversion comment. 2005-05-17 12:21:56 +00:00
Carl Worth
e72c41f95b Fix documentation to not mention set_size for the _for_bitmap functions. 2005-05-17 11:28:26 +00:00
Carl Worth
5cc39a708c Remove #ifdef munging since we once again support either #if or #ifdef. 2005-05-17 09:13:02 +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
366aa98a79 Fix more deprecation macros 2005-05-17 08:34:44 +00:00
Carl Worth
23b7ac25ed Add a few more REPLACED_BY and DEPRECATED_BY definitions.
Add some helpful warnings.
2005-05-17 08:26:37 +00:00
Carl Worth
f82a3b2b55 Add cairo-xlib-xrender.h which was missed from an earlier commit. 2005-05-17 06:12:52 +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
f67f5003df Avoid shifting 32-bit quanity by 32 bits, which is undefined behavior. 2005-05-17 06:08:01 +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
9bf669a790 Fix to include cairo-xlib.h, (which also fixes test/xlib-surface.c). 2005-05-17 00:39:17 +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
Keith Packard
200bcda188 Initialize op->stops[0].scale = 0.
This scale value is used only when computing gradient values before the defined range, in which case stop 0 is used for both ends of the interpolation, making the value of 'scale' not actually matter, except that valgrind notices we're using an undefined value.
2005-05-16 22:31:36 +00:00
Carl Worth
e5b31bca7c Remove quarter-over test name accidentally added to Makefile. 2005-05-16 15:05:56 +00:00
Kristian Høgsberg
ea410111d3 Take a filename instead of a FILE pointer. 2005-05-16 11:41:42 +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
53e6fdb885 Fix the last commit so it actually compiles now. 2005-05-14 13:22:25 +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
95859dc2c6 Add an #error if cairo-foo.h is included when cairo was compiled without support for the foo backend. 2005-05-14 10:03:56 +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
Kristian Høgsberg
15ecc87763 Make this a varg function and use the new _cairo_output_stream_vprintf() function to format extra dict contents.
Reimplement the printf logic so we can special case formatting of doubles to be locale independent and trim trailing zeros.
2005-05-13 14:04:22 +00:00
Kristian Høgsberg
b9db66eb17 Rename cairo_pdf_surface_create_for_callback() to cairo_pdf_surface_create_for_stream(), and change PDF constructors to take width and height as points and move PPI setting to cairo_pdf_surface_set_ppi() 2005-05-13 09:26:20 +00:00
Owen Taylor
9ebf15e960 Fix misplaced goto. 2005-05-13 08:09:24 +00:00
Carl Worth
7c4a2b1d6e Fix image->data to be unsigned
Track change in signedness of data member/parameter.
2005-05-12 23:11:55 +00:00
Carl Worth
d5ca4e37d7 Update xcb backend to compile after recent API changes:
Fix missing return value. (_cairo_xcb_surface_acquire_source_image): Remove calls to non-existent cairo_surface functions. (_cairo_xcb_surface_set_matrix): Update for new matrix member names. (_cairo_xcb_surface_get_extents): Fix typo.
2005-05-12 23:09:58 +00:00
Keith Packard
949daa1bc9 libpixman creates an A8 format object and sometimes forgets to destroy (when the bounds of the trapezoids are empty). Avoids creating the format object in that case.
reviewed by: cworth
2005-05-12 20:25:07 +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
Keith Packard
52f41b7bf0 _get_mask_extents creates a pixman region but neglects to destroy it.
reviewed by: otaylor
2005-05-12 08:04:22 +00:00
Owen Taylor
e4e5b1f00d Handle more cases by assuming no-super-luminescent colors. 2005-05-11 16:32:44 +00:00