Commit graph

1767 commits

Author SHA1 Message Date
Carl Worth
bef621e870 Augment tests to do better testing of paths/images with alpha.
Add a new cairo_test_paint_checkered function so that tests that draw
with alpha can easily put an easy-to-see checkered background in place
first.

Add new tests caps-joins-alpha and paint-source-alpha that do simple
tests of strokes and image painting with source pattern alpha.

Also, add the checkered background to paint-with-alpha for
consistency.
2006-04-25 01:56:51 -07:00
Carl Worth
a5afc59d0a Add PDF-specific reference image for scale-source-surface-paint
It only fails because the PDF ouput doesn't preserve the NEAREST filter attribute.
There might be a way to get something like this in the PDF, but it's not the point
of the test.
2006-04-24 16:16:19 -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
a1bba71eb9 Trivial indentation fix 2006-04-24 14:51:31 -07:00
Carl Worth
893239248a Prefer RGB24 over ARGB32 for source surfaces in tests.
Some tests were using source surfaces created as ARGB32 even though all
alpha values are entirely opaque. This meant these tests were triggering
more fallbacks than strictly necessary for what the tests are ttrying to
do.
2006-04-24 14:50:52 -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
Christian Biesinger
e0bf137804 Fix create_xcb_surface signature 2006-04-23 21:22:17 +02:00
Carl Worth
810d9d1985 PDF: Fix reference images inadvertently committed as PDF not PNG 2006-04-20 10:54:01 -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
eadb26a1c1 Add new PS-specific reference image for new-sub-path. 2006-04-18 15:19:36 -07: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
Emmanuel Pacaud
ffab2592fc Clear completely the temporary surface between each subtest in mask.c
That helps SVG backend to pass this test, since CAIRO_OPERATOR_CLEAR on a part of a surface use "comp-op" element which is not supported with current librsvg.
2006-04-18 21:52:06 +02:00
Emmanuel Pacaud
9c65dee86b Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2006-04-18 21:23:59 +02:00
Emmanuel Pacaud
36fb36fe8c SVG: Add validating ref file for unantialias tests.
Antialias property is not directly supported by SVG, and probably not the most wanted feature. In the future, we could use an image fallback in order to emulate it, or try to use text-rendering, shape-rendering and image-rendering
properties (http://www.w3.org/TR/SVG/painting.html#RenderingProperties).
2006-04-18 21:22:58 +02: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 

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
62d2f7cbf3 SVG: Return UNTESTED for test involving operators.
unbounded-operator, operator-clear, operator-source, clip-operator
2006-04-17 09:54:03 +02:00
Emmanuel Pacaud
347083b3f0 SVG: Add reference files for antialiased text tests.
Currently, text are rendered as paths in SVG files, so, when rendered to png through librsvg, they don't match general reference images.
2006-04-16 16:00:27 +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
e890bfd2bf Ignore dash-zero-length 2006-04-14 17:26:23 -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
Carl Worth
687802cca6 Obnoxious churn of gtk-doc templates.
We really need to get these built files out from under version control, (or
else abandon gtk-doc altogether).
2006-04-14 14:44:16 -07:00
Emmanuel Pacaud
d284c2b5a4 SVG: enable SVG backend API documentation in /doc 2006-04-14 23:11:35 +02:00
Emmanuel Pacaud
b9eb4f018e PDF: Fix typo in documentation. 2006-04-14 22:55:48 +02:00
Emmanuel Pacaud
e952e0aff8 SVG: Add documentation for public API. Fix test filenames and add testing of CAIRO_CONTENT_COLOR 2006-04-14 22:53:58 +02:00
Emmanuel Pacaud
f919ba858f SVG: Emulate CLEAR and SOURCE operators on paint call when no clipping region is defined. 2006-04-14 22:06:28 +02:00
Carl Worth
8f3c60096d Add a new cairo_paginated_surface_backend_t rather than just a single function pointer. 2006-04-14 11:33:48 -07:00
Carl Worth
5461f25df9 Fix _composite_trap_region to restore the original clip when done. 2006-04-14 11:05:37 -07:00
Carl Worth
c81569d2f1 Flesh test-paginated-surface out into a complete surface.
This adds an aactual test_paginated_surface_backend rather than just
having this test surface create a paginated surface around an image
surface. This is a more realistic test of what a paginated surface is
and should be more useful as an example of how to use the paginated
surface, (and in particular the analysis portions).
2006-04-14 11:05:35 -07:00
Carl Worth
41dc06d711 Add new PS-specific image for dash-zero-length test.
This reference image demonstrates the bug that occurs when we emit zero-length
dash segments into a PostScript file with butt caps.
2006-04-14 10:08:31 -07:00
Carl Worth
11b4d24671 Move cairo_pdf_surface_backend to file end so it's easier to find. 2006-04-14 09:36:41 -07:00