Commit graph

1124 commits

Author SHA1 Message Date
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
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
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
7beb3e27a5 Quiet some 'may be used uninitialized' warnings. 2006-05-03 16:45:33 -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
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
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
Emmanuel Pacaud
1264ae9af4 SVG: Really use width and height in point unit.
I guess it makes more sense to use a unit for
specifying image size that doesn't depend on context.
2006-05-02 23:35:06 +02:00
Emmanuel Pacaud
773692b7df Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2006-05-02 21:52:41 +02:00
Emmanuel Pacaud
bd85701b4f SVG: Minor documentation fixes. 2006-05-02 21:48:11 +02:00
Carl Worth
8488aaee1a PS: Add cairo_ps_surface_set_size along with ps-features test
Add a new cairo_ps_surface_set_size which can be used to produce a
PostScript file consisting of pages of various different sizes (or
orientations).

Also add a new test (ps-features.c) for testing this and subsequent
ps-specific function calls.
2006-05-02 12:36:35 -07:00
Carl Worth
e59f35291f atsui: Add missing check of return-value of malloc.
This addresses the original problem noted in mozilla's bug #336129:

	Missing out-of-memory check at gfx/cairo/cairo/src/cairo-atsui-font.c:185
	https://bugzilla.mozilla.org/show_bug.cgi?id=336129

This also adds a comment pointing out another malloc that is not
checked, (but does not fix it).
2006-05-02 11:38:29 -07:00
Carl Worth
41e288a880 Make backend-specific function set a surface error on type mismatch.
If any backend-specific, surface-modifying function is called with
the wrong surface type we set an error on that surface.
2006-05-02 11:38:28 -07:00
Emmanuel Pacaud
0e4527c67e SVG: Rework of API for SVG selection.
I've removed cairo_svg_surface_create_xxx functions, and instead implemented
the following ones:

cairo_svg_surface_restrict_to_version
cairo_svg_get_versions
cairo_svg_version_to_string
2006-05-02 14:50:40 +02:00
Carl Worth
32f120e488 Don't return void from void-returning function (fix #6792).
It's a dumb part of the C standard and it's even dumber when compilers are
picky about it. But oh, well.
2006-05-01 15:12:46 -07:00
Carl Worth
87bd00326e Fix silly typo from previous commit. 2006-05-01 14:52:25 -07:00
Carl Worth
8dff692db6 Support multiple glyph image formats within the same font (fix #4705).
If we find a glyph image of a format that is different from the font's
format, then we use a temporary image and convert to the font's
format.

This provides a simple fix for the crash identified in bug #4705:

	crash at XRenderAddGlyphs
	https://bugs.freedesktop.org/show_bug.cgi?id=4705

A later improvement would guarantee that the "font's format" was
carefully chosen to be able to contain all glyphs in the font without
information loss.
2006-05-01 14:50:48 -07:00
Emmanuel Pacaud
e3b3402eb8 SVG: Correct use of paginated surface. Fix emit of alpha filter. 2006-05-01 23:21:37 +02:00
Emmanuel Pacaud
8e5ada5201 SVG: Trivial indentation and comment fixes. 2006-05-01 22:53:46 +02:00
Emmanuel Pacaud
62831dc10e SVG: Remove outdated comment. 2006-05-01 22:53:12 +02:00
Emmanuel Pacaud
22c799d5b3 SVG: Fix error handling in create_for_document and in composite_image_pattern. 2006-05-01 22:52:47 +02:00
Emmanuel Pacaud
6f49f7b76d SVG: Add an additionnal API for creating SVG 1.1 or 1.2 files.
And update documentation.
2006-05-01 22:51:25 +02:00
Emmanuel Pacaud
2e4d0e5ba7 SVG: Some variable/type renaming. 2006-05-01 22:50:42 +02:00
Emmanuel Pacaud
e5ea8268b0 SVG: Reenable optimisation of CLEAR and SOURCE in paint when there's
no active clipping path.
2006-05-01 22:49:58 +02:00
Emmanuel Pacaud
55685d7173 SVG: Code cleanup. 2006-05-01 22:49:29 +02:00
Emmanuel Pacaud
926bb6480c SVG: Initial support of operators support via image fallbacks.
We need to add a public API that will let user select
a compatibility level regarding produced SVG files.

This patch also plugs a memleak.
2006-05-01 22:47:41 +02:00
Emmanuel Pacaud
061d508898 SVG: Sort of working implementation of a SVG backend with paginated surface
support.

        Unoptimized and with memory leaks.
2006-05-01 22:43:15 +02:00
Emmanuel Pacaud
59dcb95ce5 SVG: First pass for analyze-surface support 2006-05-01 22:41:12 +02:00
Emmanuel Pacaud
bdc1c1ac78 Copy content property when doing a snapshot of a meta surface. 2006-05-01 22:12:20 +02:00
Henning Noren
516ac16de1 Fix PS Surface Memleak
Fixes leak of 16 bytes when calling _cairo_ps_surface_finish by never freeing
the closure allocated in _word_wrap_stream_create.
2006-04-28 07:04:56 -07:00
Carl Worth
5821d88119 Correct documentation to say "user space", not "user-space" where appropriate. 2006-04-27 11:45:26 -07:00
Emmanuel Pacaud
9bca27a1ad Optimisation of CLEAR operator in meta-surface.
This optimisation takes care to not replay what was done
before surface is cleared. We don't erase recorded commands
since we may have earlier snapshots of this surface.
(cherry picked from 926e2494ca2211e9117ab70fc427208d125e1bd5 commit)
2006-04-27 06:39:41 -07:00
Emmanuel Pacaud
a732058920 Implement paginated create_similar, moving similar images down to PS and PDF.
The new paginated create_similar simply forwards to target backend create_similar.

We maintain the fact that PS and PDF surfaces are returning image
surfaces for create_similar by moving that explicitly to their own
create_similar functions.

(This commit is the combination of the following original commits:

	6b69e8c012adb4f2fc2ee9c1579fed8214e8f510
	2589db92a4395f8e900dbc4eafc45982f0d985d3
)
2006-04-27 06:36:16 -07:00
Carl Worth
e1be80b020 paginated: Remove memory leak of analysis surface from _paint_page
Thanks to Henning Noren <henning.noren.402@student.lu.se> for pointing this out.
2006-04-27 06:02:46 -07:00
Carl Worth
09a51a4e03 Add reference to cairo_surface_set_user_data in docs. for cairo_image_surface_create_for_data 2006-04-27 05:44:57 -07:00
Carl Worth
7601a07ae9 Remove cairo.def from the generated tar file. It's not useful there. 2006-04-26 14:34:02 -07:00
Behdad Esfahbod
74ec21b2a7 WIN32: Define SHADEBLENDCAPS and SB_NONE if they are not defined. (from Tor Lillqvist)
(cherry picked from d3ff5228a2 commit)
2006-04-26 14:31:36 -07:00
Zhe Su
fe8bf47afc Support fontconfig embeddedbitmap option/handle transformation issue as well. 2006-04-25 10:20:42 -07:00
Carl Worth
22ab0e5f16 Fix default font options for PS and PDF backends.
The paginated surface layer was missing its get_font_options function.
It now defers to the target surface. The PDF backend already had a
get_font_options function, but the PS backend was also missing it.

This should fix the problem with 72DPI hinting seen in glyph paths in
PostScript output.

Thanks to Owen Taylor for identifying this problem and the correct
fix.
2006-04-25 05:44:08 -07:00
Keith Packard
8d635a3aa9 PDF: Execute entire path in user coordinates when stroking so that line params are interpreted correctly 2006-04-25 04:04:10 -07:00
Carl Worth
134c508bf0 PDF: Add SMask output and simplify analysis to support all OVER operations.
With this SMask support, the PDF backend is now able to handle a very
large subset of the things that are likely to be thrown at it in
common operation, (for example, when handling images and text from web
pages).
2006-04-25 03:45:37 -07:00
Carl Worth
c072119043 PDF: Remove unused backend functions.
Since the switch to using paginated, we have a guarantee that the following functions
will never be called. So we drop them now:

	_cairo_pdf_surface_composite
	_cairo_pdf_surface_fill_rectangles
	_cairo_pdf_surface_composite_trapezoids
	_cairo_pdf_surface_old_show_glyphs
2006-04-25 03:26:25 -07:00
Carl Worth
32a7edc42d PDF: Fix surface pattern transformation and support for EXTEND_NONE.
There's a bunch of careful matrix transformation here needed to
resolve the differences between cairo and PDF pattern matrices,
(primarily due to the different location for the origin).

This fixes the several PDF test suite failures that recently appeared
when we switched from ARGB32 to RGB24 source surface patterns.
2006-04-24 16:11:21 -07:00
Carl Worth
28e25e1cce Fix broken error-checking in cairo_{ps,pdf}_surface_set_dpi 2006-04-24 12:40:30 -07:00
Carl Worth
12c4c375af Fix invalid restore that was causing subsequent pages after first to be inverted 2006-04-24 11:15:09 -07:00
Carl Worth
7fa8bfd738 PDF: Cleanup error handling of emit_image_rgb_data 2006-04-20 10:01:45 -07:00
Carl Worth
c5d5687ac0 PDF: Add simple implementation of _cairo_pdf_surface_show_glyphs (text as paths).
This isn't very exciting text output---it simply turns every call to
cairo_show_glyphs into a single filled path. But at the very least,
text will no longer trigger image fallbacks for the PDF backend.

With this commit, the following tests change from all-fallback to
all-native for the PDF backend:

	show-text-current-point
	text-antialias-gray
	text-antialias-none
	text-antialias-subpixel
	text-cache-crash
	text-rotate

There are rasterization differences in the output (cairo vs. freetype)
so this commit also adds new PDF-specific reference images for some of
those tests so that the suite continues to report PASS.
2006-04-19 11:07:19 -07:00