Commit graph

546 commits

Author SHA1 Message Date
Kristian Høgsberg
476fe9a66e Implement path clipping and refactor _cairo_gstate_clip() out in three different functions corresponding to the three different clipping modes.
Add NULL pointers for intersect_clip_path.
New test case to exercise PDF clipping code.
2005-06-14 19:45:22 +00:00
Carl Worth
663e39a63c Remove Boolean 'drawable' parameter from the create_similar surface backend function since nothing anywhere is actually using this parameter. 2005-06-14 15:38:15 +00:00
Tor Lillqvist
d2ddfe42a9 Correct extents for text with a general tranform. 2005-06-14 14:12:00 +00:00
Carl Worth
bb7eeeb749 Remove comment suggesting ambiguity of whether cairo_get_target references the surface, (we decided as part of the API shakeup that cairo functions returning pointers to internal objects do not automatically take a reference). 2005-06-14 11:58:14 +00:00
Carl Worth
8084fb9b09 Add new _cairo_pattern_create_in_error.
Propagate error values from cr->status to pattern->status.
2005-06-13 16:53:52 +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
15fb5e0d27 Originally 2005-05-08 Owen Taylor <otaylor@redhat.com>:
If cairo_create() fails, return a special static object, cairo_nil.
Don't return early if cr->status is set. cr->status should not affect reference counting.
Ignore any magic object with a reference count of -1.
2005-06-13 16:35:03 +00:00
Carl Worth
01e1844e9c Originally 2005-06-02 Carl Worth <cworth@cworth.org>:
Add a status field to cairo_path_t.
Add documentation for the new approach for handling errors in these functions---always returning a valid pointer with at least a status. (cairo_append_path): Propagate path status errors to the context. Add note to documentation on initializing path->status.
Add missing cairo_private qualifier to a couple functions.
Track new status field in cairo_path_t. (cairo_path_destroy): Don't destroy cairo_path_nil. Add documentation. (_cairo_path_data_create): (_cairo_path_data_create_flat): (_cairo_path_data_append_to_context): Add documentation. (_cairo_path_data_create_in_error): New function to create a placeholder cairo_path_t just to propagate a cairo_status_t error.
2005-06-13 16:29:26 +00:00
Carl Worth
730fb40455 Make these functions static, which allows slightly less awkward error handling within them. 2005-06-11 01:09:15 +00:00
Carl Worth
df19a5aa7e Provide font-backend-specific macros for FONT_FAMILY_DEFAULT. Change CAIRO_FT_FONT_FAMILY_DEFAULT from "serif" to "" to allow the actual default to come from the system/user configuration. 2005-06-11 00:06:04 +00:00
Carl Worth
ff2dee65bd Pull the enum out from inside cairo_path_data_t and give it a name of cairo_path_data_type_t. This allows C++ programs to see the enum values. It also allows variables to be declared of this type for manually constructing a cairo_path_t. 2005-06-10 23:47:23 +00:00
Carl Worth
6cd484a4c0 Originally: 2005-06-09 Carl Worth <cworth@cworth.org>
Rework occurrences of 'if (status == CAIRO_STATUS_SUCCESS)' to use 'if (status)' instead where trivial.
2005-06-10 12:46:49 +00:00
Carl Worth
31dcb954fe Remove STATUS_OK macro which was not being used universally. 2005-06-10 12:18:20 +00:00
Carl Worth
e6eef09115 Remove trailing comma from enum values which gcc 4.0 does not want to see (Luis Villa). Closes bug #3502. 2005-06-09 12:27:02 +00:00
Keith Packard
c1c8c57b90 Font matrix was output incorrectly; the implicit mirror-in-y transformation was not computed correctly, missing a negation of the 'xy' component. 2005-06-07 23:28:12 +00:00
Carl Worth
4f2f520dce Allow NULL as a valid value for several objects. That is, calling reference or destroy on these objects will simply do nothing, successfully.
Remove extra whitespace.
2005-06-03 16:45:46 +00:00
Kristian Høgsberg
7b4a65dba4 When clipping, update the clip surface to a new surface the size of the intersection of the old clip surface and the extents of the new clip path. 2005-06-03 16:40:15 +00:00
Carl Worth
7c47633b2c Remove unused cache->refcount and _cairo_cache_reference().
Remove gratuitous nesting as recommended in CODING_STYLE.
2005-06-03 16:22:26 +00:00
Carl Worth
756e991b91 Fix name of _cairo_user_data_array_destroy to be _cairo_user_data_array_fini. 2005-06-03 16:16:44 +00:00
Carl Worth
42c1fb7c91 Rename functions to match the naming scheme used by cairo-cache.c and all other users of it. Though it's quite likely that glitz had this right and now everything could be changed to match it instead. I'll save that for some day when we're cleaning up the cache code. 2005-06-03 16:08:28 +00:00
Carl Worth
5699072035 Fix Freudian unwrapped line in paragraph describing why long lines should be wrapped. 2005-06-03 15:54:40 +00:00
Carl Worth
36beed9bf1 Add CODING_STYLE document to standardize on some style issues.
Standardize brace handling around all else clauses according to new CODING_STYLE guidelines.
2005-06-03 14:51:57 +00:00
Kristian Høgsberg
f87fd91bcf Patch from Tomasz Cholewo <cholewo@ieee-cis.org>:
Store the index of the checksum instea of a pointer to the location.
2005-06-03 10:28:42 +00:00
Carl Worth
bb00e0fce5 Move internal convenience up from _cairo_gstate_set_source_solid to _cairo_set_source_solid so that all set_source functions flow through cairo_set_source. 2005-06-03 09:38:39 +00:00
Carl Worth
4914eac983 Remove obsolete _cairo_gstate_set_target_surface, folding its contents into _cairo_gstate_init, most of which disappears due to constant folding. Ensure that gstate->next is initialized even if _cairo_pattern_create_solid fails.
Remove unused _cairo_xcb_surface_set_clip_region.
2005-06-01 13:36:20 +00:00
Carl Worth
c56938e568 Rename CAIRO_OK to STATUS_OK. No intended changes in functionality. 2005-06-01 13:24:10 +00:00
Carl Worth
045ba795da Rename gstate->surface to gstate->target. No intended changes in functionality. 2005-06-01 13:19:52 +00:00
Carl Worth
6c62cf7643 Remove unused fields from cairo_gstate_t, (font_family, font_slant, font_weight). Reorder fields to match between declaration and initialization and to put the most problematic fields (surface and source) at the end. No intended changes in functionality. 2005-06-01 13:13:10 +00:00
Carl Worth
37a48e674c Fix bug in converting box to rectangle that left clip_rect.height uninitialized, (leading to unpredictable, intermittent test failures). 2005-06-01 00:29:24 +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
Olivier Andrieu
63428d3cc7 : Fix memory leak 2005-05-26 17:35:35 +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
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
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
9bf669a790 Fix to include cairo-xlib.h, (which also fixes test/xlib-surface.c). 2005-05-17 00:39:17 +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