Commit graph

721 commits

Author SHA1 Message Date
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
Carl Worth
35b9e3c45d More _/- renames in the test directory. 2005-03-29 00:02:19 +00:00
Carl Worth
9bb1715159 Move surface-specific cairo_t functions to cairo.c.
Remove functions that have now moved to cairo.c.
A few new files to ignore now with new compilation mode using a libtool helper library.
2005-03-23 13:49:32 +00:00
Carl Worth
c629df8616 * src/cairo.c: (cairo_copy_path), (cairo_copy_path_flat), (cairo_append_path): Rename cairo_copy_path_data, cairop_copy_path_data_flat, and cairo_append_path_data to cairo_copy_path, cairo_copy_path_flat, and cairo_append_path.
Add new cairo_path_t, containing a cairo_path_data_t array and an explicit length. Remove CAIRO_PATH_END_PATH terminator from cairo_path_data_t.
Rename the internal path object from cairo_path_t to cairo_path_real_t.
2005-03-18 14:28:53 +00:00
Kristian Høgsberg
58420806bb From Tor Lillqvist <tml@novell.com>:
Open output PNG files in binary mode.
2005-03-17 13:13:56 +00:00
Kristian Høgsberg
0f52fb2289 Dont call user data destroy function if it's NULL.
Add test case for user data with NULL destroy function.
2005-03-16 12:15:29 +00:00
Carl Worth
30e771d811 Add reference image. 2005-03-14 11:49:12 +00:00
Carl Worth
f385e5f3e4 Fixes to force tests to run against locally compiled version (thanks to Manish Singh). 2005-03-14 11:14:13 +00:00
Carl Worth
a98430092f Added some documentation, so we get some churn here.
New functions: cairo_copy_path_data, cairo_copy_path_data_flat, and cairo_append_path_data.
Add new implementation for cairo_copy_path_data and cairo_append_path_data.
New test for new path_data functions.
2005-03-11 14:29:15 +00:00
Kristian Høgsberg
b032d02322 Fix assert()'s using = instead of ==.
Move xunlink call below the xasprintf that builds the filename to unlink.
2005-03-10 09:22:20 +00:00
Carl Worth
c67ba13a6e Originally: 2005-02-24 Carl Worth <cworth@cworth.org>
Add const qualifier to cairo_user_data_key_t arguments.
Originally: 2005-02-15 Kristian Høgsberg <krh@redhat.com>
Add these two functions to set and get user data on an surface.
Function prototypes for new functions.
Test case for user data functions.
2005-03-10 08:59:11 +00:00
Carl Worth
0daf6b1745 Move filename initialization up to before first use.
Add test for the most trivial cairo_get and cairo_set functions.
2005-03-09 14:34:26 +00:00
Carl Worth
c3bd9b1b8d Change the draw function under test to return a cairo_test_status_t so that it can indicate test failure even if there is no result image. 2005-03-09 13:58:20 +00:00
Carl Worth
6d4653fe22 Rename all the cairo_current functions to cairo_get functions instead. Add documentation for all of these functions (and a few others as well).
Add support so that old binarys should still run and old source should still compile, (though we'll rip that out again on the API Shakeup flag day).
2005-03-09 12:35:36 +00:00
Carl Worth
980eff38e4 Commit workaround to prevent make distcheck from making bogus complaints that gtk-doc is not enabled. 2005-03-08 19:30:19 +00:00
Carl Worth
e586688e6b Look for png images in ${srcdir}/filename as well, so that make distcheck can still find them.
Add romedalen.png to EXTRA_DIST so the tests can pass from the tar file.
Fix typo: cairo-win3 -> cairo-win32.
Add cairo-win32.xml to the list, so it gets generated as well.
Add pointer to new win32 documentation.
2005-03-08 19:25:39 +00:00
Carl Worth
627338ab4a Fix accidental commit of diff, rather than ref image. 2005-03-08 14:30:14 +00:00
Carl Worth
c05059f62f Update coverage-ref.png due to seemingly harmless, though not entirely understood changes. 2005-03-08 14:25:54 +00:00
Carl Worth
246a07022a Shared function for checking unlink errrors. (cairo_test): Move all error messages to test-specific log files for quieter test output.
Make pixman_rotate an expected failure.
2005-03-08 13:44:14 +00:00
Owen Taylor
e7607bb379 Comment and clean up the gradient computation. (_cairo_linear_pattern_classify): Determine if a linear gradient is horizontal or vertical. (_cairo_pattern_acquire_surface_for_gradient): Optimize horizontal/vertical gradients with a repeating surface.
Test case for linear gradients at angles and with a rotated pattern matrix.
2005-03-06 12:05:23 +00:00
Carl Worth
de7d69aff9 Add pixman_rotate to ignore list. 2005-02-24 12:30:23 +00:00
Carl Worth
604e333be2 Convert to utf-8 encoding. 2005-02-22 11:32:02 +00:00
Carl Worth
8c8ced2573 Added testsvg script 2005-02-15 15:07:25 +00:00
Kristian Høgsberg
7296349eaa New test case which exposes off-by-one rotation error in pixman. 2005-02-07 09:38:43 +00:00
Owen Taylor
199c41dafe Mostly-functioning Win32 font backend; no glyph paths yet.
Turn on building of the Win32 font backend.
src/cairo-win32-private.h src/Makefile.am: Private header for the Win32 backend.
src/cairo-win32-private.h src/cairo_win32_surface.c: Internally export _cairo_win32_print_gdi_error() for use in the font code.
src/cairo-win32-private.h src/cairo_win32_surface.c: Add _cairo_win32_surface_create_dib to create a DIB surface.
src/cairo-win32-private.h src/cairo_win32_surface.c: Add _cairo_surface_is_win32()
Check for vasnprintf.
Add a simple fixed-buffer size snprintf fallback in the absence of vasnprintf.
2005-02-01 21:45:51 +00:00
Kristian Høgsberg
a24f2f909e Update prototype to eliminate warning.
Remember to reference surfaces when copying patterns.
Don't call _gstate_create_pattern for internally created patterns. (_cairo_gstate_show_surface): Don't change the surface matrix here, it's done later when we set it up as a pattern.
Correct clip_twice-ref.png filename.
Add these.
Fix broken intersection code.
2005-01-28 12:27:23 +00:00
Kristian Høgsberg
56c96d0140 Update these two once again, this time generated using libpixman-0.1.3 without leaky circles. 2005-01-27 12:28:17 +00:00
Kristian Høgsberg
81d03b3048 Fix missing rounding in these two functions.
Update these to versions with properly rounded alpha values.
Move clip_twice out of XFAIL now that rounding works.
Add new test cases.
2005-01-27 11:40:29 +00:00
Kristian Høgsberg
17ec6f1482 The overall idea of this rewrite is that we want to pass the source pattern all the way down into the backends. The motivation for this is that not all backends want a surface for the source operand, and by passing the pattern down, backends can choose to convert it to a surface if they need that.
The patch removes the create_surface function pointer from the surface vtable and moves much of that code into a couple of helper functions. The composite, compsite_trapezoids, and show_glyphs backend functions are updated to take a cairo_pattern_t instead of a surface as the source.
Change these functions to not create a surface for the pattern and just pass the pattern down to the backend functions.
New function to translate a set of trapezoids.
Break out the code to adjust and restore surface transformation and repeat settings into _cairo_pattern_prepare_surface and _cairo_pattern_restore_surface.
Split cairo_pattern_create_for_surface into an init function and a create function.
Utility functions to create a surface from a pattern.
Update these backends to work with the new pattern API. Glitz work by David Reveman.
Update these to pass through the new set of args.
Update this reference image as we now render it correctly.
2005-01-27 10:46:20 +00:00
Kristian Høgsberg
2654df6afb New test case to verify that the clip surface is correctly updated when extending an existing clip path. 2005-01-26 21:46:01 +00:00