Commit graph

259 commits

Author SHA1 Message Date
Billy Biggs
53444c286e Add a new API for disabling antialiasing of shapes drawn by cairo. This is a hint and is not supported by all backends.
Store the antialiasing mode in the gstate and pass it to the backend for trapezoid rendering and for clipping.
Pass the antialiasing parameter down to the backend where appropriate.
Pass the antialiasing parameter down to the backend where appropriate.
Add support for A1 format trapezoid rendering, and remove the _create_mask_image function, creating a temporary image from memory we allocate and clear.
Support A1 masks to disable antialiasing using the RENDER extension when requested.
Support A1 masks to disable antialiasing using the RENDER extension when requested.
Blindly pass through the antialising parameter.
Add the antialiasing parameter but don't support it.
Add a test case and a reference image from the latest libpixman.
Add the new antialiasing disabling API to the docs.
Update progress on a parameter to disable antialiasing.
reviewed by: cworth, otaylor
2005-08-08 18:35:22 +00:00
Carl Worth
2e1eaa88ff Remove CAIRO_BEGIN_DECLS and CAIRO_END_DECLS which don't belong here. 2005-08-05 10:46:40 +00:00
Carl Worth
e59d1dff7f Ignore cairo-clip-private.h.
Drop non-existent cairo-atsui.xml.
Fix misnamed parameters in comment blocks.
Include config.h so HAVE_UNISTD_H gets picked up as necessary.
2005-08-05 10:40:32 +00:00
Carl Worth
59d7f60249 Add some missing declarations to the appropriate sections.
churn
Rename cairo_path_nil to _cairo_path_nil since it may be exported, and tag it cairo_private to try to avoid exporting it. Qualify it as const well.
Track new name of _cairo_path_nil and cast away the const as required.
2005-08-05 10:30:31 +00:00
Carl Worth
72f40f58bb More obnoxious tmpl churn 2005-08-05 10:03:04 +00:00
Owen Taylor
480951827e src/cairo.h src/cairoint.h src/cairo-surface.c: Add cairo_mark_dirty[_rectangle]() and cairo_flush() for
Implement a cairo_flush() that restores the original clip. Also restore the original flush when a surface is finished.
Check off the item.
2005-08-01 11:45:42 +00:00
Carl Worth
3f385a0330 More doc/public/tmpl churn. 2005-07-28 11:34:47 +00:00
Carl Worth
5d7c796c18 Remove all create_in_error functions as they were just muddling up the memory management semantics:
_cairo_path_data_create_in_error _cairo_pattern_create_in_error _cairo_surface_create_in_error
Don't bother with extra check of other->status to anticipate and try to prevent cairo_surface_create_similar from returning through cairo_surface_create_in_error.
Just return &_cairo_surface|pattern|path_nil rather than _cairo_surface|pattern|path_create_in_error.
After checking surface->status from a cairo_<foo>_surface_create function, just return CAIRO_STATUS_NO_MEMORY since that's the only error we'll get from one of these create functions.
Remove unnecessary check for gstate == NULL;
Fix old check for image == NULL instead of image->base.status.
Add missing check of surface->image_base.status after creating surface->image.
Add missing check of surface->base.status after creating surface.
2005-07-28 09:46:38 +00:00
Carl Worth
2b5d9c8e00 Add CAIRO_STATUS_INVALID_CONTENT, CAIRO_STATUS_INVALID_FORMAT, and CAIRO_STATUS_INVALID_VISUAL.
Change functions to return type of void:
cairo_scaled_font_extents cairo_surface_finish
Add new functions to query object status:
cairo_scaled_font_status cairo_surface_status
Implementation of new error handling scheme for cairo_surface_t and cairo_scaled_font_t.
Track change in return value of cairo_surface_finish.
2005-07-27 15:39:34 +00:00
Carl Worth
ea1218a434 Replace all occurences of refcount with ref_count.
Replace refcounted with reference-counted.
2005-07-25 16:23:05 +00:00
Owen Taylor
85b74d8216 src/cairo.[ch] src/cairo-gstate-private.h src/cairo-gstate.c src/cairoint.c: Add cairo_{get,set}_font_options().
Add cairo-xlib-private.h
Update
reviewed by: cworth
2005-07-25 12:29:23 +00:00
Carl Worth
e9c321e66b Initial import of preliminary tutorial pieces. 2005-07-22 06:20:53 +00:00
Owen Taylor
075cf23cdc src/cairo-font-options.c src/cairo.h src/cairoint.h src/Makefile.am: Add an opaque cairo_font_options_t structure.
src/cairo-font.c src/cairo.h src/cairoint.h: Add a cairo_font_options_t object to cairo_scaled_font_create().
src/cairo-surface.c src/cairoint.h: Add virtualized cairo_surface_get_font_options() to get the font options for a surface.
Adapt to cairo_scaled_font_create() change.
Add an implementation of get_font_options() that turns off metrics hinting.
src/cairo-xlib-screen.c src/cairo-xlib-private.h: Add a "screen info" structure that holds (for now) information about the default font options for the screen.
Implement get_font_options()
src/cairo-ft-font.c src/cairo-ft.h: Add functions to apply a cairo_font_options_t to a FcPattern or get the load flags for a cairo_font_options_t.
Adapt to font options additions. Add support for non-antialiased rendering of scalable fonts. Add support for turning off metrics hinting.
Adapt to font options additions.
doc/public/Makefile.am doc/public/cairo-sections.txt: Update.
reviewed by: cworth
2005-07-21 06:52:13 +00:00
Øyvind Kolås
687f3d78d6 minor whitespace and spellfix 2005-06-22 09:49:48 +00:00
Carl Worth
86869f02b9 Force distcheck to enable gtk-doc. 2005-06-20 17:01:36 +00:00
Owen Taylor
ea2a04d901 Workaround for https://bugs.freedesktop.org/show_bug.cgi?id=3566
Detect servers with a bug in repeating surfaces by checking vendor string and version.
For such surfaces
Save clip rects when setting a clip region on a surface so that we set the right clip for the surface's GC if we create it later.
2005-06-20 15:48:46 +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
3b8da5f213 Remove references to repeat and matrix fields that no longer exist. 2005-06-17 23:22:20 +00:00
Carl Worth
7c811e0ac6 update documentation build stuff 2005-06-16 12:31:56 +00:00
Owen Taylor
615d509767 Remove --only-section-tmpl; it doesn't really work currently :-(. 2005-06-15 16:04:19 +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
Carl Worth
14ae3ce3ad No longer need to check for NULL after creating a pattern.
Propagate status errors from pattern->status to cr->status.
Originally 2005-05-08 Owen Taylor <otaylor@redhat.com>:
src/cairo-pattern.c src/cairoint.h: If allocation of pattern objects fails, return special static nil pattern objects.
If adding a color stop fails to allocate memory, set pattern->status. (And fix a memory leak.) Make public functions return when pattern->status is set, (and no longer return a cairo_status_t).
src/cairo-pattern.c src/cairo.h doc/public/cairo-sections.txt: Add cairo_pattern_status()
Check the status of gstate->source and of mask patterns passed in.
2005-06-13 16:36:40 +00:00
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
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
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
Owen Taylor
59c2730b1d src/cairo-xlib-surface.c src/cairo-xlib.h: Remove leftover cairo_xlib_surface_create(). 2005-05-10 21:06:01 +00:00
Owen Taylor
2e72b70124 doc/public/language-bindings.xml doc/public/cairo-doc.xml doc/public/Makefile.am: Document suggested conventions and techniques for many aspects of creating a language binding for Cairo. 2005-05-07 14:31:01 +00:00
Owen Taylor
35248a17fd Update. 2005-05-07 10:35:35 +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
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
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
Owen Taylor
86a17d5357 Updated.
src/cairo-png.c src/cairo.h: Fix up some doc build issues.
2005-04-26 15:28:01 +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
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
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
Owen Taylor
47824dee31 src/cairo.h src/cairo-gstate.c src/cairo-font.c: Add a cairo_font_face_t type to hold a description of a font face. Replace cairo_set_font() with cairo_set_font_face().
src/cairoint.h src/cairo-font.c src/cairo-gstate.c: Add "cairo_simple_font_face" for family/weight/slant and use it to implement font naming for the toy API.
src/cairo-ft.h src/cairo-ft-font.c cairo-win32.h cairo-win32-font.c: Switch the FreeType and Win32 backends over to using cairo_font_face_t.
src/cairo.h src/cairo-font.c src/cairo-ft-font.c src/cairo-win32-font.c: Pass in font matrix and CTM separately rather than as a composite scale when creating fonts; allows removing font_matrix argument to metrics functions.
src/cairoint.h src/cairo-font.c src/cairo-ft-font.c src/cairo-win32-font.c: Remove cairo_font_scale_t type, just use cairo_matrix_t and ignore translations.
src/cairo-ft.h src/cairo-ft-font.c: Remove cairo_ft_font_get_pattern() -- it can't work for all FreeType backend fonts and doesn't seem particularly useful.
Rename cairo_font_get_extents() to cairo_font_extents()
split font functions into a separate section.
Fix locking order problem.
Add caches for simple font faces and from cairo_font_face_t to cairo_scaled_font_t.
src/cairo.h src/cairoint.h src/cairo-font.c src/cairo-win32-font.c src/cairo-ft-font.c src/cairo-gstate.c src/cairo-gstate-private.h: Rename cairo_font_t to cairo_scaled_font_t.
2005-04-07 11:03:59 +00:00
Owen Taylor
e66e4c7b8c src/cairo.h src/cairo_surface.c src/cairo-xlib.h src/cairo_xlib_surface.c: Move cairo_xlib_surface_set_device_offset() to a generic cairo_surface_set_device_offset().
Take the surface's device offset into account.
Update.
2005-03-17 12:57:42 +00:00
Owen Taylor
5fecf69e2c src/cairo-xlib.h src/cairo_xlib_surface.c: Rework set of contructors for XLib surfaces. Add cairo_xlib_surface_set_size().
src/cairo-xlib.h src/cairo_xlib_surface.c: Add cairo_xlib_surface_set_device_offset().
Rewrite for clarity and efficiency.
Use a temporary pixmap to avoid possible BadMatch when fetch from windows.
src/cairo.[ch] src/cairo-xlib.h: Fix some parameter names for the docs.
Update
2005-03-15 16:25:30 +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
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
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
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
Owen Taylor
913e39b6ee src/cairo_font.c src/cairo.h doc/public/cairo-sections.txt: Add cairo_font_extents().
src/cairo_win32_font.c src/cairo-win32.h doc/public/cairo-sections.txt: Rename cairo_font_create_for_logfont() into cairo_font_create_for_logfontw() to make clear what it takes. Don't add cairo_font_create_for_logfonta() for now.
2005-02-02 23:14:55 +00:00
Owen Taylor
749a8c1e7b src/cairo_win32_font.c doc/public/cairo-sections.txt doc/public/Makefile.am: Add windows functions to the docs. 2005-02-02 19:52:22 +00:00
Owen Taylor
711d7965c8 src/cairo_unicode.c src/cairoint.h src/Makefile.am: Add _cairo_utf8_to_utf16(), _cairo_utf8_to_ucs4() based on code from GLib.
Add CAIRO_STATUS_INVALID_STRING
Use _cairo_utf8_to_ucs4().
Add cairo_bool_t
Add TRUE/FALSE definitions.
src/cairo.[ch] src/cairoint.h src/cairo_gstate.c: switch cairo_in_stroke/cairo_in_fill and all the functions used to implement them over to cairo_bool_t.
2005-02-01 15:06:33 +00:00
Owen Taylor
e0de000336 src/cairo.[ch] src/cairo_font.c src/cairo_ft_font.c src/cairo_ps_surface.c src/cairo_xlib_surface.c: Move docs from docs/reference, with a fair bit of addition and rewriting.
Remove old-format docs.
Add a AC_PREREQ(2.54) (Jason Dorje Short)
2005-01-27 15:46:16 +00:00
Owen Taylor
0f5b7d82de configure.in Makefile.am docs/Makefile.am docs/public/*: Add framework for doing docs via gtk-doc.
src/cairo.[ch] src/cairo-matrix.c: Add some inline docs for arcs and matrices.
gtk-doc.m4 acinclude.m4: Check in files from gtk-doc to make the dependency on gtk-doc optional.
Add --enable-gtk-doc to the default args.
2005-01-27 11:35:25 +00:00
Owen Taylor
97424a3c2a Change cairo_font_t to refer to a font scaled to a particular output device resolution.
src/cairoint.h src/cairo_font.c src/cairo_ft_font.c src/cairo_xlib_surface.c src/cairo_pdf_surface.c src/cairo_gstate.c src/cairo.c: Switch many internal methods from handling cairo_unscaled_font_t and cairo_font_scale_t pairs to handling cairo_font_t.
src/cairo-ft-private.h src/cairo_ft_fontc: Add some internal interfaces for use by the FreeType backend.
Clear the gstate's current font when the transform or target surface changes.
src/cairo.h src/cairo_ft_font.c: Rename cairo_ft_font_pattern to cairo_ft_font_get_pattern().
src/cairo.h src/cairo_ft_font.c: Make cairo_ft_font_create() and cairo_ft_font_create_for_ft_face() take a font scale; make the latter take load_flags for FT_Load_Glyph() as well. Change cairo_ft_font_face() to Xft-style cairo_ft_font_lock_face, cairo_ft_font_unlock_face.
Remove the name/slant/weight=>unscaled font cache, it didn't work with the new cairo_font_t setup. If it turns out to be needed, it can be added back in some other form.
src/cairoint.h src/cairo_font.c: Add a 'flags' field to cairo_glyph_cache_key_t, we use it for load flags with freetype backend.
Switch the caching to be from resolved fontconfig pattern => file; keep only a fixed number of FT_Face objects open at once, similar to FreeType.
src/cairo_gstate.c src/cairoint.h: Add public cairo_font_glyph_extents, use it to implement _cairo_gstate_glyph_extents().
Add refcounting for glyph cache elements; there was an bug where elements got ejected from the cache and freed before they could be used.
src/cairoint.h src/cairo_cache.c (_cairo_cache_random_entry()) New function to return a random entry in the cache matching a predicate; reuse the internals for the previous _random_live_entry().
src/cairoint.h src/cairo_cache.c (_cairo_cache_lookup()): Add an optional created_entry return value.
src/cairo_ft_font.c src/cairo_xlib_surface.c: Adapt to _cairo_cache_lookup() change.
Support max_memory == 0 to indicate an unbounded cache.
src/cairoint.h src/cairo_cache.c (_cairo_cache_remove()): Add a function to manually remove entries from the cache.
Update for changes, document cairo_matrix_t, cairo_glyph_t, etc.
src/cairo.h src/cairo-atsui.h src/cairo-ft.h src/cairo-glitz.h src/cairo-pdf.h src/cairo-png.h src/cairo-ps.h src/cairo-quartz.h src/cairo-xcb.h src/cairo-xlib.h: Add CAIRO_BEGIN/END_DECLS for extern "C", use it on all public headers. Move header guards outermost.
Fix encoding.
2005-01-21 14:33:47 +00:00