Commit graph

122 commits

Author SHA1 Message Date
Bryce Harrington
b4e218c3e8 Drop the target-specific huge-radial.pdf.*.ref.png images
These two images are mis-rendered (clearly evident from visual
inspection).  By removing them, the test will fall back to the more
general format-specific images, huge-radial.argb32.ref.png and
huge-radial.rgb24.ref.png.

Note that the huge-radial.pdf tests still fail to pass, but the pdiff
looks more sensible.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66218

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2014-10-29 15:45:17 -07:00
Bryce Harrington
82cd66f833 test: Update pixman downscaling 95 reference images
The pixman downscaling "95" tests attempt to rescale a 96x96 pixmap to
95x95.  Ideally the borders between color areas should be sharp, but for
this use case we allow for 1 pixel of blur between the areas as
acceptable.  The choice of what color to use for this blurred region is
not important, and in fact varies from backend to backend.

The old reference images were generated by Krzysztof Kosiński's
downscaling algorithm.  These new images are against the algorithms
written by Bill Spitzak.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-10-09 18:28:53 -07:00
Chris Wilson
14df211b9c test: Add whole flipped replays
When investing the symmetry of the raterisation, we want to have a
simple replay of all of the original geometry through a the flipped
recording surface. This reduces the worry about artifacts from the
clipped rendering.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 13:08:50 +01:00
Chris Wilson
7aacd81bef test: Refresh reference images for tor rendering changes
(And include a git add missed from commit

ccd48b3464
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 30 14:06:21 2014 +0100

    test: Remove more duplicated reference images

but were mostly invalidated by the rasteriser changes anyway).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 08:46:44 +01:00
Chris Wilson
50b41e2145 test: Add a simple rasteriser to check fidelity of edge rendering
In order to check the behaviour of the analytic rasteriser inside tor,
let's compare it against a very simple rasteriser that uses a rectiliner
256x256 sample grid.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 00:06:27 +01:00
Chris Wilson
0c42d5c176 test: Add another coverage example demonstrating the seams in tor
References: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 16:15:33 +01:00
Chris Wilson
95e147bfa0 test: Explicitly flip the reference image for recordflip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 14:33:50 +01:00
Chris Wilson
ccd48b3464 test: Remove more duplicated reference images
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 14:06:36 +01:00
Chris Wilson
167561f282 tor: Review full-row walker
When updating the quorem between cells, we would lose the overflow
increment as it was only applied locally and not preserved by updating
the quorem.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 13:57:05 +01:00
Chris Wilson
03c3d4b7c1 tor: Fix loss of precision from projection onto sample grid
The goal is to preserve the precision in the gradients of the edges and
only apply the projection into the final cell location. We also include
the half-subrow offset as spotted by Massimo.

References: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Testcase: coverage-rhombus
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 12:01:13 +01:00
Chris Wilson
8e1e2a5414 test: Remove redundant reference images
If we have both a argb32 and rgb24 reference image that are identical,
we can replace them with a plain reference image. I also prefer to have
argb32/rgb24 versions of the reference images if rgb24 differs from the
plain reference.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 11:47:44 +01:00
Ravi Nanjundappa
93c21e3fd3 test: Add test for egl-surface-source
This test file attempts to use a EGL backend surface as a source
surface for all other backends.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-09-29 16:08:23 -07:00
Chris Wilson
5c03b20732 test/coverage: Exercise invariance under mirror symmetry
Massimo noticed that the record/record-flip were not being rasterised as
identical mirror images due to a half-subpixel offset in the tor scan
converter. This test attempts to reproduce this error by rendering a
rhombus around the origin of each cell (that is it generates 4 mirror
images of a triangle in the 4 different orientations0. The expectation
is that each pixel in the group is lit identically as the coverage is
identical.

References: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-29 08:42:17 +01:00
Chris Wilson
80359e73d8 test: Exercise stroking bugs with xlib/trapezoids
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 12:35:47 +01:00
Uli Schlachter
3e22a8580a pthread-same-source: Refresh reference images
These reference images are generated by the new GENERATE_REFERENCE mode that the
previous commit introduced.

I have no idea what the "base" images. From my reading of the code in
boilerplate/, these images will be used by the test-XXX targets. However, these
seem to generate the same result than e.g. the image backend. Thus, I deleted
these files.

There is still pthread-same-source.quartz.xfail.png. This file was created in
commit b6e16b8d and touched in commit 5a1e590b1. No idea if this is still valid
and since I don't have a Mac, I won't touch it.

The test is still broken on the following backends (out of the backends I have
compiled in). This mostly seems to be differences in image scaling, but I
couldn't figure out an easy way to tell the test suite that the new results are
correct.

test-paginated, ps2, ps3, xcb, xcb-window, xcb-window&, xcb-fallback, xlib,
xlib-window, xlib-fallback, recording

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-17 11:32:56 +02:00
Adrian Johnson
2974416dfc Add test for paint with alpha and clipping bug
Add test case for https://bugs.freedesktop.org/show_bug.cgi?id=68382

Something has regressed in the recording surface. All the recording
surface based backends lose the alpha from the paint_With_alpha.
2013-12-26 17:18:41 +10:30
Adrian Johnson
acd78d721e Add test for rectangle path optimization with non rectilinear pen
This fails on pdf/ps.
2013-12-26 15:27:30 +10:30
Søren Sandmann Pedersen
98fef3cef2 _cairo_color_double_to_short(): Use standard rounding algorithm
The _cairo_color_double_to_short() function converts a double
precision floating point value in the range of [0.0, 1.0] to a
uint16_t integer by dividing the [0.0, 1.0] range into 65536
equal-sized intervals and then associating each interval with an
integer.

Under the assumption that an integer i corresponds to the real value i
/ 65535.0 this algorithm introduces more error than necessary as can
be seen from the following picture showing the analogous
transformation for two-bit integers:

    +-----------+-----------+-----------+-----------+
   0b00         |  0b01     |      0b10 |          0b11
    +-----------+-----------+-----------+-----------+

which shows that some floating point values are not converted to the
integer that would minimize the error in value that that integer
corresponds to.

Instead, this patch uses standard rounding, which makes the diagram
look like this:

    +-------+---------------+---------------+-------+
   0b00     |      0b01     |      0b10     |      0b11
    +-------+---------------+---------------+-------+

It's clear that if the values corresponding to the given integers are
fixed, then it's not possible to decrease the resulting error by
moving any of the interval boundaries.

See this thread for more information:

    http://lists.freedesktop.org/archives/cairo/2013-October/024691.html

Reference images updated:

  pthread-similar.ref.png
  record-paint-alpha.ref.png
  record90-paint-alpha.argb32.ref
  record90-paint-alpha.rgb24.ref.png
  xcb-huge-image-shm.ref.png
  xcb-huge-subimage.ref.png

All of these have only one-step differences to the old images.
2013-10-22 14:27:43 -04:00
Adrian Johnson
412a4c34d9 test: update mime-data to test jbig2 mime types 2013-09-15 21:27:50 +09:30
Bryce Harrington
ac5f3e2b8e test: Move cairo_pattern_set_filter to after cairo_set_source_surface
Also update the image.arg32 reference images, since for now we're just
accepting pixman's output as truth.  This fixes up several tests:

                   was   is
 Tests run:        420   420
 Passed:           224   261
 Failed:           195   159
 Expected Failed:  0     0
 Error:            0     0
 Crashed:          0     0
 Untested:         0     0
 Total:            420   420

Thanks to psychon for finding the code error in the test.
2013-09-11 19:32:08 +02:00
Bryce Harrington
ade7089f72 test: Exercise image scaling quality when downscaling
This adds testcases for the various cairo filter options, each of which
match to corresponding pixman filters.  Use the 'downscale' keyword if
invoking tests using cairo-test-suite.

The 24-pixel reference images were produced from quad-color.png using
Gimp's Scale Image command with Interpolation set to None.  It is
assumed that all filters should handle a 1:4 scaling cleanly with no
antialiased blurring.

The 95-pixel reference images assume differing types of antialiasing
based on the quality level.  We are using the image.argb32 output as
reference here.  Potentially some other rendering algorithm could
conceivably provide better results in the future.

The 96-pixel reference images are simply copies of the original
quad-color.png file.  It is assumed that 1:1 downscaling operations
should produce no visible change to the original image.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-09-11 19:32:08 +02:00
Bryce Harrington
0f554c36d3 test: Test a variety of scales when downscaling
Downscaling from 96 to 24 is easy since it's an even multiple, so try
scaling by -1 pixel too.

This adds a 1:1 scaling test case as well, which should pass through the
image unchanged.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-09-11 19:32:08 +02:00
Bryce Harrington
642b6d8091 test: Add test for image downscaling
This adds pixman-downscale.c, which tests correctness of PNG images
scaled down using pixman routines.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-09-11 19:32:08 +02:00
Uli Schlachter
9058e9ae28 Add new test for bug 61592
This test exercises some clipping-related failure that Seongwon Cho reported.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61592
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04 21:57:12 +02:00
Uli Schlachter
54bee5e0fc Fix caps-tails-curve reference images
Commit d7f5a1bec fixed a bug. This caused 12 new test failures for the
test-traps test target:

caps-tails-curve degenerate-arc degenerate-path joins subsurface
subsurface-scale twin twin-antialias-gray twin-antialias-mixed
twin-antialias-none twin-antialias-subpixel user-font

Most of these are indeed (new?) bugs. However, caps-tails-curve actually started
producing the expected result and the reference image just wrongly captures the
old state of things.

At the time of that commit, just taking the output from test-traps as the new
reference image works fine for all backends. However, with current git,
something introduced more antialiasing noise and now test-traps changed again
while cairo-xcb stayed with the old result. Thus, we also need a new reference
image to fix this test.

(The wrong reference images come from commit 8488ae02 which turned test-traps'
results into reference images)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04 21:57:12 +02:00
Chris Wilson
8b4151a5e5 test: Remove conflicting .ref.png, .argb32.ref.png, .rgb24.ref.png
Where a content specific reference image exists, prefer to have both
content reference images (i.e. both argb32.ref and rgb24.ref) rather
than a mix of .ref and argb32/rgb24.
2013-07-04 10:02:46 +01:00
Chris Wilson
9eb1237e00 test: Add a few reference images found lurking on my machine 2013-07-04 09:40:37 +01:00
Chris Wilson
3255462a23 test: Remove all identical (cmp & pdiff) reference images
Courtesy of the improved check-ref-dups written by Bryce Harrington:

Running make check on the codebase (with default configuration) with the
redundant images removed produces essentially the same test results:

Before
------
Tests run:        13687
Passed:           9216
Failed:           3566
Expected Failed:  312
Error:            1
Crashed:          17
Untested:         575
Total:            13687

After
-----
Tests run:        13689
Passed:           9216
Failed:           3566
Expected Failed:  312
Error:            1
Crashed:          19
Untested:         575
Total:            13689

(with the exception being the pthread tests misbehaving between runs)
2013-07-04 09:27:56 +01:00
Chris Wilson
e34b800214 test: Extend testing of joins for fine lines 2013-06-04 11:52:30 +01:00
Chris Wilson
a2d8524973 test: Expand testing of caps for fine strokes 2013-06-04 11:52:26 +01:00
Chris Wilson
02b467a287 test: Exercise replaying a recording surface through a flip matrix 2013-02-12 10:46:42 +00:00
Chris Wilson
93ddc3a283 tests: Update reference images after adjustments to polygon line clipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-10 13:13:31 +00:00
Chris Wilson
350f9fb536 test: Refresh refs for aa noise following reduction of the 2-stage compositing
A side effect of

commit c986a7310b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jan 24 08:55:54 2013 +0000

    image: Enable inplace compositing with opacities for general routines

is that we should in theory be reducing the rounding errors when
compositing coverage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 15:15:03 +00:00
Uli Schlachter
5fb364287f test: Add xcb-huge-subimage
This creates an image surface with a non-natural stride and paints it to a
similar surface.

In the xcb backend, this causes a call to _cairo_xcb_connection_put_subimage()
which tries to send a huge PutImage request. As a result, xcb kills the X11
connection.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:10 +01:00
Chris Wilson
2dd4ff3206 test: Add stroke-clipped
Exercise a bug in the determine of clip-bounds when stroking, as
reported by ed44.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 14:48:40 +00:00
Chris Wilson
d7f5a1bec4 pen: First check whether the in/out edges lie within the single pen vertex
In order to prevent underflow when searching for the closing pen vertex,
we first need to be sure that it does not simply lie next to the opening
pen vertex. As a result we were missing many cases that should have been
a bevel (in == out) and generating almost complete round caps instead.

Reported-by: Dominik Röttsches <dominik.rottsches@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56432
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 09:27:52 +00:00
Chris Wilson
8488ae022d test: Refresh reference images for slight alteration of curves 2012-10-05 13:29:06 +01:00
Chris Wilson
c05147b215 test: Refresh reference image for clip-disjoint-quad
Rather than using the traps reference for all target as this then
generates false negatives with the spans compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 11:41:58 +01:00
Chris Wilson
3969f2c687 test: Add clip-disjoint-quad
Exercises a bug in the polygon intersection code demonstrated by Søren
Sandmann.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 09:58:50 +01:00
Chris Wilson
2a0d817432 tests: Add outline-tolerance
From https://bugs.freedesktop.org/show_bug.cgi?id=53841:

"Rectangle drawn incorrectly when it has zero height
and miter limit greater than 1.414"

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-20 13:34:33 +01:00
Chris Wilson
ff22ab4c10 test: Add example from bug-51910
The calculation of the required source extents blows up under xlib.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 21:57:03 +01:00
Chris Wilson
7b6f9fd140 test: Add a simple exercise for raster sampling of subpixel geometry
Test that the rasteriser doesn't incorrectly merge disjoint geometry at
the subpixel level.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 21:57:03 +01:00
Chris Wilson
3d482e266f test: Exercise bug in joining together spline segments around cusps
Carl Worth demonstrated a glaring bug in the new stroking code,
introduced in commit 545f30856a (stroke: Convert the outlines
into contour and then into a polygon), whereby only a bevel join was
being used to connect segments around a sharp inflection point.

This adds the two examples he reported to the test suite.
2012-06-24 11:53:09 +01:00
Chris Wilson
43105a89d8 test: Restore bug-seams reference
An overzealous update after converting antialiasing missed the object of
this test was exactly to point out an error due to the antialiasing. So
restore it back to the prestine reference and mark the image backend as
failing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 08:49:39 +01:00
Chris Wilson
3ae8bce832 test/record90: Rotate the reference so that it is wholly visible
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 12:27:47 +01:00
Chris Wilson
e73830915b test: Refresh unbounded-operator
Apparently this too suffered from bug-bo-collins and is fixed by
(bo-rectangular: Emit subsummed boxes for overlapping edges).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 12:20:50 +01:00
Chris Wilson
7b2f787d19 test: Exercise rectangular bo bug
Reported-by: S. Christian Collins <s_chriscollins@hotmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49446
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 11:50:34 +01:00
Chris Wilson
e41dffb329 stroke: Don't drop clockwise==0 lines
If the join indicates the pair of edges are parallel, we may be
considering the final segment of the spline with a different tangent
vector than the slope of the final edge and so lead to false dropping of
an edge. This has the effect that the line segments between 'arc arc arc
arc' (a rounded rectangle) are no longer horizontal or vertical. As path
construction tries to eliminate joins between colinear segments, this
optimisation should not be required anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 18:11:28 +01:00
Chris Wilson
6cd1f5040f clip: Apply clip boxes to the clip surface
As we convert the unaligned clip boxes to a region, we need to process
the intersection of the boxes with the clip surface as a separate step.

Fixes tighten-box for the base compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 23:14:21 +01:00
Chris Wilson
4ea3ace6c8 spans: Only fallback for a clipmask if unbounded
For a bounded operation with a clip we will already have performed the
clip geometrically.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:53:55 +01:00