Commit graph

1883 commits

Author SHA1 Message Date
Robert O'Callahan
4a4603d551 Add Xlib surface getter functions.
Add the following five functions:

cairo_public Display *
cairo_xlib_surface_get_display (cairo_surface_t *surface);

cairo_public Drawable
cairo_xlib_surface_get_drawable (cairo_surface_t *surface);

cairo_public Screen *
cairo_xlib_surface_get_screen (cairo_surface_t *surface);

cairo_public Visual *
cairo_xlib_surface_get_visual (cairo_surface_t *surface);

cairo_public int
cairo_xlib_surface_get_depth (cairo_surface_t *surface);
2006-05-04 04:03:19 -07:00
Emmanuel Pacaud
68915fdfcb SVG: Fix xml namespace declaration.
It looks like since libxml2 2.6.24, we can't just use xmlSetProp
for namespace declaration anymore.
2006-05-04 12:56:06 +02:00
Carl Worth
7aa2b05e48 Add missing prototype for _cairo_clip_translate 2006-05-04 03:44:45 -07:00
Robert O'Callahan
7bcf957b4e Rename cairo_rectangle_t to cairo_rectangle_fixed_t.
This is in preparation for a later function addition for extracting
clip rectangles from a cairo_t, (which will add a public
cairo_rectangle_t).
2006-05-04 03:43:34 -07:00
Carl Worth
d71ddec8df ROADMAP: Note that device-offset and push-pop-group have landed. 2006-05-04 03:05:12 -07:00
Vladimir Vukicevic
fb7f7c2f27 Fix up clip at pop_group time, to keep it in surface backend coordinates
We keep the clip in surface-backend coordinates always, so it needs
fixing whenever we change the target surface out in the gstate.  The
only place this happens is in push_group, so fix it as part of
gstate_redirect().
2006-05-04 03:02:27 -07:00
Vladimir Vukicevic
7fa3c6eee5 Add push-group test and reference images 2006-05-04 02:53:45 -07:00
Vladimir Vukicevic
ee02c1b914 Implement push_group/pop_group
This patch adds the following API calls:

 cairo_push_group
 cairo_push_group_with_content
 cairo_pop_group
 cairo_pop_group_to_source
 cairo_get_group_target

These methods support implementing layers on top of a cairo context,
allowing for drawing with transparency and temporary buffering.
cairo_get_group_target allows an app to get access to the actual surface
created by the last push_group call, in case itneeds to perform native
drawing to it.
2006-05-04 02:52:38 -07:00
Carl Worth
5e708b38e0 Merge branch 'device-offset-history' into cairo 2006-05-04 01:46:34 -07:00
Carl Worth
a6b1b014bb Implement the device_offset functionality at surface, not gstate layer
This is a mega-patch that has the advantage that the entire test suite
passes both immediately before and immediately after this commit.

The disadvantage of the mega-patch is that it does not reflect the
development history of the device-offset branch, (with its various
fumblings and flailings). To capture that history, we will next merge
in that branch.
2006-05-04 01:45:41 -07:00
Carl Worth
99719bde9e Move device-offset touchups from the surface layer up to the gstate.
This fixes the self-copy test which was the last one that was really
failing due to device offsets.
2006-05-04 01:34:05 -07:00
Carl Worth
ee687d722a Add support to handle the device-offset of a source surface.
This change caused all self-copy failures to now pass.
But, it also causes all previous self-copy passes to now fail.
2006-05-04 01:33:54 -07:00
Carl Worth
ea2faa5fae Rip out device_{x,y}_scale.
This device scale stuff is currently not being used. However it is also adding
complexity to the current device-offset rework. And since it's not being tested
I'm sure we're getting it wrong. It's better to not even have it here rather
than having it be broken.
2006-05-04 01:33:37 -07:00
Carl Worth
0e230727f8 Prefer classic C style comments rather than C++/C99-style 2006-05-04 01:30:59 -07:00
Carl Worth
f9333e9975 Remove dead code from _cairo_surface_{acquire,release}_dest_image 2006-05-04 01:30:59 -07:00
Carl Worth
f66ce88e0e cairo_surface_mark_dirty_rectangle: correct sense of device-offset handling 2006-05-04 01:30:59 -07:00
Carl Worth
460820cb58 Remove undesired device-offset handling during unbounded fixups.
This code was already commented as being suspicious and its removal causes some
tests to start passing once again.
2006-05-04 01:30:58 -07:00
Carl Worth
b0c047ad95 _cairo_surface_show_glyphs: Fix reversed device-offset handling so text works again. 2006-05-04 01:30:58 -07:00
Carl Worth
ee1c642cd8 cairo-surface.c: Correct reversed semantics of SURFACE_TO_BACKEND and BACKEND_TO_SURFACE 2006-05-04 01:30:58 -07:00
Carl Worth
a5cb546212 _cairo_surface_set_clip_region: Remove device-offset handling that is
now taken care of in _cairo_clip_clip.
2006-05-04 01:30:58 -07:00
Carl Worth
69affa5faf Move device-offset handling for clipping from _cairo_surface_interesect_clip_path
to the more general _cairo_clip_clip to handle more cases correctly.
2006-05-04 01:30:58 -07:00
Carl Worth
50dcd4d1ac _cairo_surface_copy_pattern_for_destination: Don't do any transform if there is no offset 2006-05-04 01:30:58 -07:00
Carl Worth
6d212c9e39 _cairo_surface_copy_pattern_for_destination: Remove leaking second call to pattern_init_copy 2006-05-04 01:30:57 -07:00
Carl Worth
81e469523f Abstract away repeated test as _cairo_surface_has_device_offset_or_scale 2006-05-04 01:30:57 -07:00
Carl Worth
4ed3e60a25 _cairo_surface_copy_pattern_for_destination: Fix transformation sign/order.
This allows the scale-source-surface-paint test to start passing again
at least.
2006-05-04 01:30:57 -07:00
Carl Worth
d3ff6f0e4b _cairo_surface_fallback_composite_trapezoids: Remove unused variable. 2006-05-04 01:30:57 -07:00
Vladimir Vukicevic
46a1f40b7d Move device offsets handling into high-level operations only (stroke/fill/paint/etc)
Remove all device offsets handling from internal cairo_surface methods,
which will become truly internal shortly.  Have all device offsets
handled by top-level entry points (stroke/fill/paint/show_glyphs/mask, and
clipping).
2006-05-04 01:30:57 -07:00
Carl Worth
6197d5a761 Fix bug in test suite causing PS and PDF to fail with rgb24 and device offsets.
Patch from cworth@cworth.org.

The trick with this one is that the test suite is using device offsets
in a rather fabricated way, and the final copy from an offset surface
to a non-offset surface is between two surfaces of the same size, so
must be 1:1. To get this we turn the device offset off before the
copy.

In a more conventional use of device offsets the surfaces would be of
different sizes, and the offset would be desired during the copy.
2006-05-04 01:30:56 -07:00
Vladimir Vukicevic
51cf7900e4 Take device offsets into account when compositing scaled glyph images
Scaled glyph image surfaces have device offsets set on them to indicate
the location of the glyph origin; however, those offsets weren't being
taken into account for the call to composite, so the glyphs were
being doubly-offset by this amount.
2006-05-04 01:30:56 -07:00
Vladimir Vukicevic
4894f5a234 Implement device offset/scale at cairo-surface layer
This patch implements device offset/scale at the cairo-surface layer,
instead of them just being multiplied into the CTM at operation time.
This allows identical drawing operations/clips/paths/etc. to operate
identically on a surface with or without a device offset (and still
have things end up in the same place relative to the dev offset).
2006-05-04 01:29:42 -07:00
Carl Worth
40b39dddf9 Shrink the size of a couple of tests (and update reference images).
Shrink linear-gradient and text-pattern test outuput.

The real motivation for this is to hide an annoying difference in the
gradient output that occurs when under the influence of a device
offsets. My opinion is that the gradient output should not change due
to just an integer offset, but we currently don't have a precise
gradient specification, so this minor deviation really isn't relevant.

A better fix for this might have been to make the test suite more
forgiving of tiny differences, (perhaps on a per-test basis), but
another advantage of shrinking these tests is that they now run a lot
faster.

It is true that these tests now also exercise fewer different output
values, but that's not the designed purpose of the tests so I don't
feel bad about losing that characteristic.
2006-05-03 23:44:59 -07:00
Vladimir Vukicevic
b3e2252b94 Augment test framework to test everything under device offsets as well.
[With this change, two tests with gradients exhibit subtle differences
under device offsets. I don't think we actually care about them
though. -cworth]
2006-05-03 23:42:45 -07:00
Carl Worth
7beb3e27a5 Quiet some 'may be used uninitialized' warnings. 2006-05-03 16:45:33 -07:00
Carl Worth
8a174a1139 Add test/pdf-features.c missing from an earlier commit 2006-05-03 13:20:07 -07:00
Carl Worth
7c825797c8 Add pdf2svg utility for manual testing (not used in test suite) 2006-05-03 13:18:40 -07:00
Carl Worth
6f9aa014ae ROADMAP: Note that PDF per-page size setting is done. Sort things that appear in 1.1.4 2006-05-03 13:13:10 -07:00
Carl Worth
c35bfffa10 Add new pdf-features test to exercise cairo_pdf_surface_set_size 2006-05-03 12:39:45 -07:00
Carl Worth
eb1b102e9a PDF: Add new cairo_pdf_surface_set_size for doing per-page size changes 2006-05-03 12:39:23 -07:00
Carl Worth
5448278d6e ps-features: Minor touchups (missing include, typo in error message) 2006-05-03 12:38:49 -07:00
Carl Worth
a4fc0c2e2c PS: Use ceil, not rounding when computing integers for BoundingBox 2006-05-03 11:11:25 -07:00
Emmanuel Pacaud
e91b2c87cc SVG: Emit "svg" version in document_finish.
At least when there's something valid in document->svg_version.
2006-05-03 14:53:25 +02:00
Emmanuel Pacaud
5336cf5a98 SVG: Only "comp-op" property when svg_version >= 1.2 2006-05-03 14:47:01 +02:00
Emmanuel Pacaud
57ddc7a869 SVG: Emit correct version property of "svg" element. 2006-05-03 14:29:54 +02:00
Carl Worth
3ee4bae920 Increment CAIRO_VERSION to 1.1.5 after making the 1.1.4 snapshot 2006-05-03 01:58:03 -07:00
Carl Worth
044bc5b2a5 Update version to 1.1.4 and add notes to NEWS file.
Also update libtool version information to 7:0:5.
2006-05-03 01:32:05 -07:00
Carl Worth
7cf6bcaeca RELEASING: Replace references to ChangeLog with git log commands (and improve those) 2006-05-03 01:30:55 -07:00
Carl Worth
65dd361c49 SVG: Enable the SVG backend to be built by default (if dependencies are met) 2006-05-03 01:18:06 -07:00
Carl Worth
6acc836df2 Add backend-specific reference images to EXTRA_DIST so they'll go out in the tar file. 2006-05-03 00:57:28 -07:00
Carl Worth
b6fefaef9b ROADMAP: Indicate that PS printing-oriented API is done now. 2006-05-03 00:56:34 -07:00
Carl Worth
09dfd6c3c1 PS: Add three new public functions for emitting DSC comments.
This commit adds the following new functions to the cairo-ps API:

	cairo_ps_surface_dsc_comment
	cairo_ps_surface_dsc_begin_setup
	cairo_ps_surface_dsc_begin_page_setup

Many thanks are due to Michael Sweet who provided invaluble guidance
during the design of this API.

It is hoped that with this API in place, basically all printer control
that is likely to be desired to be performed with cairo PostScript
output is now possible.

This commit augments the ps-features test to exercise the new API.
2006-05-03 00:26:22 -07:00