Commit graph

1900 commits

Author SHA1 Message Date
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
Carl Worth
828094aef8 and delete:
cairo_set_pattern -> cairo_set_source cairo_get_pattern -> cairo_get_source cairo_set_rgb_color -> cairo_set_source_rgb
-> cairo_set_source_rgba cairo_set_alpha -> cairo_get_alpha ->
Note that we'll likely want to add cairo_set_source_surface.
Add _cairo_stock_color helper function. Improve some interfaces:
_cairo_color_init _cairo_color_init_rgb _cairo_color_set_rgb -> _cairo_color_init_rgba _cairo_color_set_alpha _cairo_color_multiply_alpha
_cairo_color_get_rgb -> _cairo_color_get_rbga _cairo_color_get_rgba_premultiplied
Add cairo_stock_t and some helper macros:
CAIRO_COLOR_WHITE CAIRO_COLOR_BLACK CAIRO_COLOR_TRANSPARENT
Fix cairo_pattern_t by eliminating pattern->alpha. Fix cairo_solid_pattern_t to use cairo_color_t rather than three doubles.
Track removal of pattern->alpha, simplifying the code considerably
Track _cairo_color interface changes. Remove gstate->alpha. Propagate down set_source renamings.
cairo_pattern_add_color_stop -> cairo_pattern_add_color_stop_rgba
and add:
cairo_pattern_add_color_stop_rgb
Remove pattern->alpha, simplifying the code considerably.
Track pattern and color interface changes.
Add const where appropriate on cairo_color_t*.
Add private type inspection predicate. (cairo_xlib_surface_set_size): Add check for surface type mismatch, (no useful error reporting yet, though).
Note coverage as en expected failure.
Improve line wrap on expected failure messages.
Port all tests to new cairo_set_source interfaces.
2005-04-14 14:42:26 +00:00
Carl Worth
c0d9c13d04 Make gradient change color in addition to just changing alpha in order to highlight distinction between interpolating in premultiplied vs. non-premultiplied space. 2005-04-14 14:02:03 +00:00
Carl Worth
65209fc39c Improve instructions for when to add a test to the XFAIL list.
Print explanations for expected failures.
2005-04-14 10:02:58 +00:00
Carl Worth
d1eb620a19 Add gradient-alpha test in preparation for upcoming cairo_set_source patch. 2005-04-14 09:31:21 +00:00
Carl Worth
95a6f1941a Add set-source test in preparation for upcoming cairo_set_source patch. 2005-04-14 09:13:48 +00:00
Owen Taylor
080f331edd Remove a stray free() (#3029, Carl Worth)
Note that the bug is fixed.
2005-04-14 06:05:59 +00:00
Carl Worth
66688da5e4 Set freed pointer to NULL.
Fix to actually set surface->finished when done. Closes bug #2950 as documented in test/surface-finish-twice.c.
Note that this bug is fixed.
2005-04-13 14:51:59 +00:00
Carl Worth
0fe6378bdb Add new test to exercise crash when calling cairo_surface_finish twice on the same surface. 2005-04-13 14:48:02 +00:00
Carl Worth
f4b2f59c05 Add new set-surface-no-show-text test.
Be sure to call cairo_destroy even if the image size is 0,0 so that we can test bugs triggered during cleanup.
2005-04-13 14:45:05 +00:00
Carl Worth
f3af02bb0e Temporarily remove all text from this test case until we come up with an approach for drawing the same text with different freetype configurations. 2005-04-13 14:24:20 +00:00
Owen Taylor
a16a634f97 src/cairoint.h src/cairo-traps.c: Add _cairo_traps_extract_region for converting trapezoids into a pixman region.
Represent all rectangular pixel-aligned regions as regions, not just single rectangles.
Split into manageable pieces, optimize rectangular pixel- aligned regions by using _cairo_surface_fill_rectangles() or _cairo_surface_set_clip_region() as appropriate.
tests/trap-clip.c tests/trap-clip-ref.png tests/Makefile.am: Add a test for trapezoids clipping.
Add an index.
2005-04-13 11:23:43 +00:00
Carl Worth
3bec073a7c Note that bug is now fixed. 2005-04-12 13:24:48 +00:00
Carl Worth
8f7ea593ba Add new test demonstrating bug in the sequence: cairo_translate; cairo_show_surface. 2005-04-11 14:04:56 +00:00
Carl Worth
2a616d6842 Move include of pixman.h from cairo.h to cairoint.h since libpixman isn't part of cairo's public interface.
Use unsigned long rather than uint32_t since we no longer have pixman.h setting that type up for us.
Remove unused variable user_data_copy.
2005-04-08 14:06:32 +00:00
Owen Taylor
c803908d95 src/cairo.h src/cairo-font.c src/cairoint.h doc/public/cairo-sections.txt: Add cairo_font_face_set/get_user_data().
src/cairo-array.c src/cairoint.h src/cairo-surface.c: Refactor user data code from cairo-surface.c into cairo_user_data_array_t.
Switch these types to be like cairo_surface_t where the generic code frees the wrapper object.
src/cairo-atsui-font.c src/cairo-ft-font.c src/cairo-win32-font.c: Fix up for the above changes.
Implement a complicated mutual-referencing scheme to make sure that a face from cairo_ft_font_face_create_for_ft_face() is freed only when the FT_Face is no longer needed.
Update the docs to describe how to figure out when the FT_Face can be freed.
Fix refcount leaks when creating fonts.
Remove excess call to _cairo_unscaled_font_reference().
Remove stray initialization of font matrix to the identity.
test/user-data.c: Fix a bug when setting/unsetting a key with a free key slot before it, add that to the test case.
Don't append an element when user_data is NULL.
2005-04-08 13:14:17 +00:00
Owen Taylor
ac6f15e245 src/cairo.[ch] src/cairoint.h src/cairo-gstate.c docs/public/cairo-sections.txt: cairo_select_font() => cairo_select_font_face() cairo_scale_font() => cairo_set_font_size() cairo_transform_font() => cairo_set_font_matrix() Add cairo_get_font_matrix(). Make cairo_set_font_face() not reset the font matrix. Default the font matrix to SCALE(10). Document cairo_select_font_face().
test/text-cache-crash.c (draw) test/text-rotate.c (draw): Use cairo_set_font_size().
src/cairo-font.c src/cairo.h: Fix up some parameter names for docs.
2005-04-07 13:29:32 +00:00
Carl Worth
945e6c2458 Fix to return non-zero status on error. 2005-04-07 11:18:40 +00:00
Carl Worth
d135938efd Rework the cairo_matrix_t interface in several ways. Expose a struct for cairo_matrix_t.
Add new function to return current matrix: cairo_get_matrix
Deprecate the following functions (in documentation): cairo_matrix_create cairo_matrix_destroy cairo_matrix_get_affine
Rename: cairo_matrix_set_affine -> cairo_matrix_init cairo_matrix_set_identity -> cairo_matrix_init_identity
Add other new matrix initialization functions: cairo_matrix_init_translate cairo_matrix_init_scale cairo_matrix_init_rotate
Change return type of almost all cairo_matrix functions from cairo_status_t to void.
Track changes to cairo_matrix_t interface.
Add a test case showing the same path drawn under various transforms, (including skews set directly by initializing a cairo_matrix_t).
2005-04-07 10:01:49 +00:00
Carl Worth
92060c12ee Make handling of unsigned char* vs. char* consistent. Change all parameters that are actual string data from unsigned char* to char* (cairo_text_extents, cairo_show_text, cairo_text_path). Change all data buffers from char* to unsigned char* (cairo_write_func_t).
Track changes from unsigned char* to char*. Convert to unsigned only at the internal interface to unicode processing.
Track change from char* to unsigned char*.
2005-04-06 13:01:13 +00:00
Carl Worth
a6d9b6a671 Change type of data parameter from char* to unsigned char*.
Propagate the unsigned char* change down the stack.
Add cast since XImage uses char* rather than unsigned char*.
Fix memory leak of image data.
Switch to use cairo_surface_write_png rather than a custom write_png_argb32.
Add test to exercise the cairo_image_surface_create_for_png function.
2005-04-04 09:47:12 +00:00
Carl Worth
5778c77382 Use the current point to offset just the destination, not the source and destination. With this fix, cairo_show_surface should work with the current point at places other than the origin.
Move move-to-show-surface off the expected failure list.
Add comment indicating that bug is resolved.
Don't use diff to compare images, just imagediff.
2005-04-02 06:00:32 +00:00