Commit graph

7203 commits

Author SHA1 Message Date
Chris Wilson
655a4dbc36 [test] Track XFAIL using expected results stored as xfail.png
Instead of tagging the sources, which is insensitive to changes, track the
known failure modes by recording the current fail as an xfail.png
reference. (We also introduce a new.png to track a fresh error, so that
they are not lost in the noise of the old XFAILs and hopefully do not
cause everyone to fret).

As we have removed the XFAIL tagging we find, surprise surprise, that some
tests are now working -- so review all the reference images (as also some
.ref.png now should be .xfail.png).

Note: I've only checked image,pdf,ps,svg. The test surfaces report some
failures that probably need to addressed in source. I've not correct the
changes for win32 and quartz. Nor fixed up the experimental backends.
2009-07-13 15:19:51 +01:00
Chris Wilson
a81cf14bd6 [test] Sanitise REFERENCE_IMAGES
Add and delete files to satisfy 'make check-ref-missing'.
2009-07-13 10:58:44 +01:00
Chris Wilson
7f3eda4e9f [test] Update reference images for gs 8.64 2009-07-13 10:46:54 +01:00
Adrian Johnson
0d44416b9d PDF: Don't round pattern y location to an integer
Using cairo_surface_get_extents() to get page height does not work
when the page height is not an integer.

http://lists.cairographics.org/archives/cairo/2009-July/017570.html
2009-07-12 19:21:28 +09:30
M Joonas Pihlaja
9686331cb0 [spans] Round rasterization grid pixel areas instead of truncating.
When converting a grid pixel area into the range [0,255] the
GRID_AREA_TO_ALPHA() macro would truncate extra bits off the result
rather than rounding. This could cause seams between abutting
collinear edges of separately rendered polygons even when the
coordinates of the abutting edges were the same.

Reported by Soeren Sandmann on the cairo mailing list:

http://lists.cairographics.org/archives/cairo/2009-May/017043.html
2009-07-10 19:06:48 +03:00
Chris Wilson
fbd88db938 [path] Don't include current-point in hash
As we don't strictly use the current-point in comparing paths, exclude it
from the hash. Similarly use the path content flags as a cheap means to
differentiate contents.
2009-07-05 15:01:08 +01:00
Chris Wilson
73f8019fd2 [path] Use cairo_list_t instead of open-coding its own
Use the cairo_list_t and its style of iterators to improve the readability
of the cairo_path_buf_t management. Note the complications that arise from
the embedding of the initial buf -- however the macros do help make the
unusual manipulations more identifiable.
2009-07-05 15:01:03 +01:00
Chris Wilson
a04e372664 [path] Add path watch debugging
Simple debug macro to print the path to stderr during construction.
2009-07-05 10:34:33 +01:00
Chris Wilson
1645352bfb [path] Evaluate is_box && is_region during construction
Whilst constructing the path, if the operations continue to be
axis-aligned lines, allow the is_box and is_region flags to persist. These
are set to false as soon as a curve-to is added, a diagonal or in the case
of is_region a non-integer point.
2009-07-05 09:30:02 +01:00
Chris Wilson
4bb157672e [test] Rename some structures within cairo-test-trace
Simply rename a few structures so that their names are less confusing with
the mix of process and threads used to executes traces.
2009-07-05 09:22:44 +01:00
Chris Wilson
53a54827f7 [boilerplate] Add missing header file.
Deleted so many, and forgot to add just this little one. Sigh.
2009-07-05 09:22:44 +01:00
Chris Wilson
ee8c50f2d6 Remove the defunct test-meta surface
Replace the internal test-meta surface will the freshly exported,
real meta-surface.
2009-07-04 22:00:09 +01:00
Chris Wilson
88cb69b10c [boilerpate] Move target definition to backends.
By moving the backend target definition out of the massive amlagamated
block in cairo-boilerplate.c and into each of the
cairo-boilerplate-backend.c, we make it much easier to add new targets as
the information need only be entered in a single file and not scattered
across three. However, updating the target interface means trawling across
all the files -- except given that I found it difficult maintaining the
single massive array I do not see this as an increase in the maintenance
burden.
2009-07-04 21:43:27 +01:00
Chris Wilson
8a10ab1c04 [script] Tidy dict construction for glyphs
Replace dict with '<< ... >>' similar to surface definitions as it is
easier to read in scripts.
2009-07-04 18:46:21 +01:00
Chris Wilson
fef3649953 [script] Fix the trivial errors running the test suite
A few typos crept in breaking the script output and various refreshes of
the expected results.
2009-07-04 18:32:57 +01:00
Chris Wilson
2395bba1e6 [any2ppm] Choose a more appropriate format for the replay content
Actually select a format that matches the request content when replaying
the script to an image.
2009-07-04 18:31:49 +01:00
Chris Wilson
9942a89870 [boilerplate] Read whole RGB lines at a time
Rather than read+unpack each pixel, read in a whole RGB packed line and
unpack the whole line in a single pass.
2009-07-04 18:30:24 +01:00
Chris Wilson
23648e2fdf [script] Prototypical binary translator
Hook into the scanner to write out binary version of the tokenized
objects -- note we bind executable names (i.e. check to see if is an
operator and substitute the name with an operator -- this breaks
overloading of operators by scripts).

By converting scripts to a binary form, they are more compact and
execute faster:

  firefox-world-map.trace 526850146 bytes
              bound.trace 275187755 bytes

[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]     null                        bound   34.481   34.741   0.68%    3/3
[  1]     null            firefox-world-map   89.635   89.716   0.19%    3/3
[  0]      drm                        bound   79.304   79.350   0.61%    3/3
[  1]      drm            firefox-world-map  135.380  135.475   0.58%    3/3
[  0]    image                        bound   95.819   96.258   2.85%    3/3
[  1]    image            firefox-world-map  156.889  156.935   1.36%    3/3
[  0]     xlib                        bound  539.130  550.220   1.40%    3/3
[  1]     xlib            firefox-world-map  596.244  613.487   1.74%    3/3

This trace has a lot of complex paths and the use of binary floating point
reduces the file size by about 50%, with a commensurate reduction in scan
time and significant reduction in operator lookup overhead. Note that this
test is still IO/CPU bound on my i915 with its pitifully slow flash...
2009-07-04 15:29:07 +01:00
Chris Wilson
07c0c8c5c0 [surface] Refactor meta-surface clone
Whilst still obnoxious, at least moving it to a separate function is more
readable.
2009-07-04 14:07:16 +01:00
Chris Wilson
7903c80ee8 [meta] Cache replays when used as a pattern source
Use the cow-snapshotting mechanism to store the meta surface replay (either
to an image inside acquire_source_image() or to a similar surface during
clone_similar()).

Fixes Bug 17971 -- Extreme slowdown for manual convolutions in most
vector backends.
https://bugs.freedesktop.org/show_bug.cgi?id=17971
2009-07-04 13:50:15 +01:00
Chris Wilson
f353ba46a3 [meta] Copy extents on snapshotting.
Need to copy across the extents as well when snapshotting.
2009-07-04 13:49:35 +01:00
Chris Wilson
f4019be7bd [trace] Remove a few transient pattern def/undef
It is easier on the eye to use
   '1 index set-source exch pop'
rather than
   'dup /p0 exch def p0 set-source /p0 undef'
(as patterns are expected to be temporary so we strive to avoid naming
them).
2009-07-04 13:16:42 +01:00
Chris Wilson
dcb7f1d034 [script] Add missing include <string.h>
As reported by Magnus Boman <captain.magnus@gmail.com>.

Fixes Bug 22610 -- Patch to add missing include in util/cairo-script/csi-replay.c
http://bugs.freedesktop.org/show_bug.cgi?id=22610
2009-07-04 08:08:25 +01:00
Chris Wilson
97bd2228a6 [script] Insert spaces around '<<' and '>>'
The dictionary constructors are just ordinary tokens so need space for
delimiters.
2009-07-03 19:41:51 +01:00
Chris Wilson
6003ab77e1 Export meta-surface
The meta-surface is a vital tool to record a trace of drawing commands
in-memory. As such it is used throughout cairo.

The value of such a surface is immediately obvious and should be
applicable for many applications. The first such case is by
cairo-test-trace which wants to record the entire graph of drawing commands
that affect a surface in the event of a failure.
2009-07-03 18:26:50 +01:00
Chris Wilson
2a9903dbbf [script] Trim some excess verbage
Remove some redundant defining of surfaces and contexts and of setting
defaults. In order to reduce the number of defines, we need to operate on
the operand stack more frequently - though in practice those operations
are quite rare.
2009-07-03 16:47:42 +01:00
Chris Wilson
28773fe79f [test-meta] Initialize image
Oops, stupid mistake - missed off the initialization of the image to NULL
from the last commit.
2009-07-03 13:19:02 +01:00
Chris Wilson
ac6c3dbbae [test-meta] Lazily allocate image
Only allocate the image on first use, as we may never actually need to
construct the image output.
2009-07-03 12:57:53 +01:00
Chris Wilson
fe73a9dd14 [test] Record trace to an in-memory meta-surface
Requires hooking into test-meta-surface currently. Export meta-surface!

The idea is that on detection of an error, we can reconstruct a minimal
trace from the meta-surface. The first step is to simply dump the trace
for the failing meta-surface. Later, we should automatically minimise
this further.
2009-07-03 12:34:10 +01:00
Chris Wilson
633efe8187 [surface] Allocate temporary region on stack
Avoid a very short-lived temporary heap allocation of a region.
2009-07-02 15:29:22 +01:00
Carlos Garcia Campos
b2e2a2f31a [test] Update argb32 pdf reference image for trap-clip 2009-07-02 15:01:41 +02:00
Carlos Garcia Campos
910afc7a8e [test] Mark all smask tests as XFAIL for pdf
Those tests use linear gradients which are not correctly handled by
poppler yet. See https://bugs.freedesktop.org/show_bug.cgi?id=10942
2009-07-02 15:01:33 +02:00
Carlos Garcia Campos
5becfc2bd5 [test] Add pdf reference image for rotate-image-surface-paint
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:56:58 +02:00
Carlos Garcia Campos
f81203cde8 [test] Add pdf reference image for mask-transformed-image 2009-07-02 14:56:48 +02:00
Carlos Garcia Campos
9d538ef337 [test] Update argb32 and rgb24 pdf reference image for mask 2009-07-02 14:56:39 +02:00
Carlos Garcia Campos
97def877bb [test] Update pdf reference image for surface-pattern
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:56:30 +02:00
Carlos Garcia Campos
8a6bdc63c1 [test] Update argb32 and rgb24 pdf reference image for text-pattern 2009-07-02 14:56:22 +02:00
Carlos Garcia Campos
b46ba7aa33 [test] Update pdf reference image for text-transform 2009-07-02 14:56:14 +02:00
Carlos Garcia Campos
9bc7ab980d [test] Update pdf reference image for filter-nearest-transformed
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
27938f7e3f [test] Update pdf reference image for filter-nearest-offset
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
e6576e8912 [test] Update argb32 pdf reference image for clip-operator 2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
13d9374ec1 [test] Remove PDF reference images for scale-source-surface-paint
It works with current poppler now
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
3710c4184c [test] Remove PDF reference images for paint-with-alpha
It works with current poppler now
2009-07-02 14:50:15 +02:00
Carlos Garcia Campos
8162acd81a [test] Remove PDF reference images for paint-source-alpha
It works with current poppler now
2009-07-02 14:50:15 +02:00
Carlos Garcia Campos
1e1f4fd092 [test] Use poppler_page_render with a transparent surface
Instead of using an opaque surface filled in white, use a transparent
surface and fill it in white by using CAIRO_OPERATOR_DEST_OVER after
rendering.
2009-07-02 14:50:15 +02:00
Chris Wilson
700a555d19 [surface] Expose a SURFACE_TYPE_MISMATCH nil object
Gah, yet more error object bloat. Must finish cairo-object.
2009-07-01 19:45:11 +01:00
Chris Wilson
8f4611a94b [perf] Fix use-after-free when retrieving error line number
We find out the status on destroying the script and then attempt to query
the defunct script for more info about the error. Wrong.
2009-07-01 19:45:06 +01:00
Chris Wilson
7c160dea54 [perf] Unbreak cairo-perf-diff builder 2009-07-01 10:12:50 +01:00
Chris Wilson
3d88f99668 [perf] Enable cairo-perf-trace in cairo-perf-diff
Only as a --trace option for now.
2009-07-01 09:57:56 +01:00
Chris Wilson
1564d67d63 [perf] Exclude the xlib-reference target from cairo-perf 2009-06-30 22:23:21 +01:00