Commit graph

1102 commits

Author SHA1 Message Date
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
Carl Worth
ab2546009f Use fallbacks in PDF backend for CAIRO_ANTIALIAS_NONE.
Perhaps there's a way to preserve that hint in PDF output, but until
we have code that actually does that, the correct thing to do is to
call it unsupported and let the fallbacks do their thing.

With this commit, the two regressions that were recently introduced
now pass again. Specifically:

	rectangle-rounding-error
	unantialiased-shapes
2006-04-18 23:31:53 -07:00
Carl Worth
241c6480cd Add implementation of _cairo_pdf_surface_paint (and fix emit_surface_pattern).
Fix general broken-ness in emit_surface_pattern, enough so that a new
implementation of _cairo_pdf_surface_paint does something useful. With
this commit, the following tests switch from all-fallback to
all-native and still pass the test suite with flying colors:

	caps-joins
	caps-sub-paths
	clip-fill-rule
	clip-fill-rule-pixel-aligned
	clip-nesting
	clip-twice
	dash-caps-joins
	dash-offset-negative
	leaky-polygon
	line-width
	paint
	path-data
	transforms

Meanwhile, the following two tests also switch from fallback to
native, but cause the test suite to complain about failures. These
both look like a mostly harmless failure to respect the ANTIALIAS_NONE
hint in the PDF output:

	rectangle-rounding-error-pdf-argb32-out.pdf
	unantialiased-shapes-pdf-argb32-out.pdf
2006-04-18 23:31:52 -07:00
Carl Worth
8be1697f2b Fix stale code in comment. 2006-04-18 23:31:52 -07:00
Christian Biesinger
a98b44a1de Fixing bad merge
The merge in 66ed9811cc
re-added this line, which makes cairo link to C++
libraries even on non-BeOS systems.

This was originally fixed in 69acfa6576
2006-04-19 02:34:55 +02:00
Carl Worth
b1b699593b Add support for _cairo_pdf_surface_stroke.
Generalize all functions that emit a source pattern to emit both
for the stroking and non-stroking PDF properties. Also add an
implementation of _cairo_pdf_surface_stroke.

With this commit in place, the following tests change from
all-fallback to all-native output while no tests report any new
failures:

	dash-zero-legnth
	fill-and-stroke
	multi-page
	new-sub-path
	rel-path
	self-intersecting
2006-04-18 16:53:23 -07:00
Christian Biesinger
efbe40bb8f Use calloc rather than malloc+memset 2006-04-19 00:31:47 +02:00
Carl Worth
448e904b2a Merge branch 'cairo' into new-sub-path
Conflicts:

	src/cairo-path-stroke.c
	src/cairo-pdf-surface.c
	src/cairo-ps-surface.c
2006-04-18 15:18:31 -07:00
Carl Worth
3f84df97dd Enable real analysis for _cairo_pdf_surface_paint.
After this patch we have three PDF tests passing with native output:

	clip-all
	fill-rule
	nil-surface
2006-04-18 11:33:49 -07:00
Emmanuel Pacaud
170a028bfa SVG: Fix mask and try to support CAIRO_CONTENT_ALPHA.
Cairo and SVG differ in their implementation of mask. Cairo only uses alpha channel where SVG uses all channels. So, before using a surface for masking, we use a filter that sets RGB channels to 1.0.

Support for CAIRO_CONTENT_ALPHA is similar and use the same filter when a SVG alpha surface is composited.
2006-04-17 23:26:30 +02:00
Emmanuel Pacaud
9e2a2ea0da SVG: Don't insert /n/r in base64 encoded image data
That doesn't work since libxml replace them by &#10;&#13;
They were intended to ease readability of generated files.
2006-04-17 11:07:15 +02:00
Emmanuel Pacaud
c01805bafd SVG: Don't check for content type in create_similar, and mark surface as modified when clearing it. 2006-04-17 10:21:50 +02:00
Emmanuel Pacaud
714bb88832 SVG: Add support for CAIRO_CONTENT_COLOR in create_similar.
Also add support for testing this feature in test/cairo-test.c
And a bunch of unwanted commit of sgml files.
2006-04-16 15:42:49 +02:00
Behdad Esfahbod
d0356a87f7 Implement cairo_set_scaled_font(). 2006-04-15 03:58:42 -04:00
Carl Worth
db111197ac Fix _cairo_surface_is_opaque to return FALSE not TRUE for non-image surfaces. 2006-04-14 17:29:19 -07:00
Carl Worth
b7309d065e Farm out the surface and pattern analysis functions away from cairo-ps-surface.c.
We're setting things up here for better sharing as PDF surface (and
others) now want to do some of the same analysis.
2006-04-14 17:25:54 -07:00
Carl Worth
a7f4f1b350 Move analysis of operators from cairo-ps-surface.c to cairo-operator.c 2006-04-14 17:03:39 -07:00
Carl Worth
c7fd35fac2 Add tests for PAGINATED_MODE_ANALYZE to PDF (no real analysis yet) 2006-04-14 16:50:16 -07:00
Dom Lachowicz
0e44e798b5 Change cairo_image_surface_create to zero out surface contents.
This closes bug #5816:

	Image surfaces do not start out blank by default
	https://bugs.freedesktop.org/show_bug.cgi?id=5816

This also fixes all of the test suite failures introduced by moving
the CLEAR on blank page optimization up to the paginated surface from
the PS surface.
2006-04-14 16:21:16 -07:00
Carl Worth
e8a0da637f Move optimization of CLEAR on blank page up from PS to paginated surface. 2006-04-14 16:18:36 -07:00
Carl Worth
b8fb8dc375 Add stub implementations of drawing operations for the PDF backend.
These new stubs explicitly return UNSUPPORTED unconditionally. This is
no different than the implicit UNSUPPORTED which the analysis surface
was inferring from NULL for 4 of the functions before.

However, _cairo_pdf_surface_fill was actually trying to draw things,
but without correctly characterizing it during the analysis stage.
This was just an oversight, as the PDF surface was always triggereing
full page fall backs anway due to the initial unsupported paint with
CLEAR.

Now, we explicitly return UNSUPPORTED for all drawing operations so we
get image fallbacks by design and not by accident.
2006-04-14 15:23:30 -07:00
Carl Worth
2726f68454 Update documentation of cairo_paginated_surface 2006-04-14 14:53:13 -07:00
Carl Worth
8d3a800b82 Add a start_page function to the paginated_surface_backend.
This allows for any surface using the paginated_surface backend to
easily do stuff at the beginning of each page, (such as writing out
any per-page header necessary).

This replaces some of the per-page state tracking that the PS surface
was doing, (though it still has some left for its optimization of
CLEAR on a blank page).
2006-04-14 14:46:59 -07:00