Commit graph

759 commits

Author SHA1 Message Date
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
a5f734455c Prototypes moved to cairo.h, this file removed. 2005-04-25 21:52:13 +00:00
Kristian Høgsberg
28e7bbea65 Renamed from cairo_surface_write_png_to_stream() for consistency. (cairo_surface_write_to_png): Renamed from cairo_surface_write_png() for consistency. 2005-04-25 21:36:38 +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
Owen Taylor
e55161d2b2 Initialize the saved_dc_bitmap field here as well ... not strictly needed, but cleaner. (Reported by Peter Arsoff) 2005-04-25 19:38:44 +00:00
Kristian Høgsberg
1c756648fc Finalize the correct pattern. 2005-04-23 11:58:18 +00:00
Kristian Høgsberg
70211bdbca Only check PNG signature if we read all the bytes. Don't fclose() the FILE argument (Steve Chaplin <stevech1097@yahoo.com.au>).
Rename to cairo_image_surface_create_for_png() to cairo_image_surface_create_from_png() and change FILE arguments for this function and cairo_surface_write_png() to be a filename argument instead.
2005-04-22 17:32:12 +00:00
Kristian Høgsberg
0f0a6a57a3 Handle backends that don't have a set_clip_region implementation (PDF). 2005-04-21 15:18:14 +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
60ec322241 Update API Shakeup chart to indicate that cairo_paint and cairo_fill_preserve patches have been sent. 2005-04-19 06:38:07 +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
ea82928aa7 Update API Shakeup chart to indicate that cairo_set_source is done. 2005-04-14 15:02:47 +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
21268bc359 Fix a comment from last commit 2005-04-13 14:04:33 +00:00
Owen Taylor
8feb2717eb Fix ChangeLog entry 2005-04-13 14:03:17 +00:00
Owen Taylor
542e6c8c90 Work around a pair of libpixman bugs (denegerate trapezoids from tesellator, pixman_region_union_rect() failing on width/height zero rectangles) 2005-04-13 14:01:50 +00:00
Carl Worth
1de5ace6c2 Fix typo 2005-04-13 13:01:54 +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
173bc22a62 Replace errant use of aclocal with , as reported by Martin Hedenfalk. Closes bug #3000. 2005-04-12 11:50:25 +00:00
Carl Worth
369d1bf28f Default to CAIRO_FILTER_GOOD rather than CAIRO_FILTER_BEST.
Optimize to use CAIRO_FILTER_NEAREST when the pattern matrix is an integer translation.
2005-04-12 09:14:14 +00:00
Carl Worth
439a94cc7b Use CAIRO_FILTER_BEST by default rather than CAIRO_FILTER_NEAREST. 2005-04-12 07:57:46 +00:00
Carl Worth
8f6fc777d1 Offset the src pattern by (0,0)->CTM. This fixes test/translate-show-surface.
Use unsigned cahr* to match new prototype for cairo_image_surface_create_for_data.
2005-04-12 07:12:08 +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
a70e8f7c9e Add deprecation alias from cairo_scale_font to cairo_set_font_size. 2005-04-11 11:30:28 +00:00
Carl Worth
9ba4dce811 Add deprecation alias from cairo_select_font to cairo_select_font_face. 2005-04-11 11:20:08 +00:00
Owen Taylor
cf9ea30078 src/cairo.h doc/public/cairo-sections.txt src/cairo-matrix.c: Update.
Include cairo-font.xml
2005-04-11 09:18:51 +00:00
Carl Worth
df997b3f5b Indentation changes 2005-04-11 06:56:10 +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
Carl Worth
584cb30145 Add ROADMAP file with an initial stab at 1.0 items. 2005-04-08 13:44:22 +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
Dave Beckett
7aa5b71e8c Update to track changes to cairo_matrix_t interface. 2005-04-08 12:42:28 +00:00
Carl Worth
30f0d517aa Eliminate internal use of deprecated cairo_matrix_copy.
Change cairo_get_matrix to accept a pointer to the return value cairo_matrix_t rather than returning the value directly.
2005-04-08 10:03:17 +00:00
Carl Worth
745627ff1b Don't try to return a value (even a void value) from a void function. Closes bug #2931. 2005-04-08 04:43:06 +00:00
Carl Worth
43435b69e1 Remove broken code for defining uint64_t. 2005-04-07 15:00:46 +00:00
Carl Worth
9bef5b6f14 Change to allow NULL backend function pointers to indicate unsupported functions.
Eliminate stub functions and replace with NULL in surface backend table.
2005-04-07 14:25:00 +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
62212867d4 Minor changes to header file inclusion recommended by Oleg Smolsky for better portability to MSVC. 2005-04-07 12:56:43 +00:00
Owen Taylor
4a3a6e8719 Fix various compilation errors. 2005-04-07 12:38:02 +00:00
Carl Worth
3ea3186f16 Use a preprocessor macro to get a literal value in the array size declaration, (for better portability to lame compilers that can't deal with a const int variable for the array size). Reported by Oleg Smolsky. 2005-04-07 12:35:33 +00:00