Commit graph

1980 commits

Author SHA1 Message Date
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
Bryce W. Harrington
33895904d5 test: Add special cases for create-from-png and fallback-resolution
These tests use reference images somewhat differently from other tests,
so treat them as special cases and avoid recommending deleting any of
their files.

Add TODO's to each test to rework them to be more consistent with other
tests.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 09:27:56 +01:00
Bryce W. Harrington
5577223489 pdiff: Drop unused variable
Fixes:
perceptualdiff.c:35:24: warning: unused variable ‘dim’
[-Wunused-variable]

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 09:27:56 +01:00
Bryce W. Harrington
319b893582 pdiff: Quell warning about signed/unsigned comparisons
perceptualdiff.c:55:19: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
perceptualdiff.c:60:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 09:27:55 +01:00
Bryce W. Harrington
9e4cac50c2 test: Make check-ref-dups utilize perceptualdiff for comparisons
The current sha1sum-based file checker does a blanket comparison of all
files with each other, which is fast but not directly helpful since it
doesn't distinguish between sibling files (which are allowable to be
duplicates).  Also, it ignores files that may have byte differences
(such as PNG header differences) but are otherwise pixel-identical.

This patch replaces the sha1sum-based checker with one that accounts for
the default fallback path and uses perceptualdiff to compare files that
are bytewise different and verify whether they actually are different.

The intention is that the output of this command can be directly used to
remove redundant files, e.g.:

  cd test
  make check-ref-dups | cut -d' ' -f2 | \
      while read f; do git rm "reference/$f"; done

This should have no impact on make check's results (modulo any tests
that behave erratically), and will help trim down the size of the
tarball.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
[ickle: rebase and add the suggested command to the Makefile]
2013-07-04 09:27:55 +01:00
Bryce W. Harrington
8d3c518e9d test: Use cmp to catch byte-by-byte identical files
cmp runs faster than perceptualdiff, and catches files that are exact
copies of the reference image.  We still use perceptualdiff for catching
files that aren't bytewise identical, but are still identical at the
pixel level.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 09:04:17 +01:00
Bryce W. Harrington
b0be0d8d42 test: Add script to check for redundant reference images
This script requires the perceptualdiff program, which can be built as
follows:

  cd test/pdiff && make perceptualdiff

The script's output provides a list of target-specific or
format-specific images that are identical to their more generic
reference files, and thus are redundant and can be safely removed from
the archive without altering any test behaviors.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
[ickle: applied Behdad's suggestion of renaming the script check-refs.sh]
2013-07-04 09:04:05 +01:00
Bryce W. Harrington
7f1be42e85 test: Fix make check-ref-dups due to move of ref images to reference/
The check-ref-dups target in Makefile.am was not updated with the new
path when the reference images were moved from test/ to
test/reference/.  Now it produces output properly again.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-04 08:57:45 +01:00
Chris Wilson
9ea5993b03 test/get-path-extents: Check exact matches within tolerance
When we refine geometry, we do so to a tolerance as specified by the
user. This means that we can not expect tessellated results to have
exact results, but always they should match within the specified
tolerance.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-20 14:11:38 +01:00
Bryce W. Harrington
d4545910e2 test: Note naming scheme for XFAIL images in README
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-06-20 11:00:59 +01:00
Bryce W. Harrington
5271f31991 test: Fix typo in sample_horizontal to use horizontal, not vertical.
Triggers the following warning during build:

sample.c:61:1: warning: ‘horizontal’ defined but not used
 [-Wunused-function]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-06-08 07:52:18 +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
Behdad Esfahbod
ff233fd706 [test] Set font size
Previously this test was working because we were not scaling bitmap
fonts.  We do now, so adjust test.
2013-03-18 14:18:13 -04:00
Uli Schlachter
592f594423 test: Fix CAIRO_REF_DIR
Ever since the test output was moved from test/ to test/output/, using
CAIRO_REF_DIR to make the test suite succeed no longer works. The test suite was
looking for the wrong file names.

This patch makes this work again. However, I am not sure that this really is the
correct fix. It just seems to work. :-)

Reported-by: Darxus <darxus@chaosreigns.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-15 16:56:42 +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
Martin Robinson
d1184b69e8 gl: Do less work when acquiring and releasing devices
After acquiring a GL device and the same GL context, surface, and
display combination is already active outside of Cairo, do not ask EGL
or GLX to change the current context as that may cause a flush on some
drivers. Also do not unset the context when releasing the device for the
same reason.
2013-01-08 15:09:33 -08: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
Uli Schlachter
d5f9c694b9 test: Define optional exception classes
According to musl libc author:

"C99 requires the FE_ macros to be defined if and only if the exception they
correspond to is supported"

So we define these macros to 0 if they are not supported. Support for these FPU
exceptions is not necessary for correct functionality, but makes some tests less
effective.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55771
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-16 17:09:42 +02: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
Andrea Canciani
93774ac034 test: Add degenerate closed path case to get-path-extents
This is a testcase to ensure that we do not regress
https://bugs.freedesktop.org/show_bug.cgi?id=54549 (which is already
fixed by b0c466e27a).
2012-09-10 23:16:08 +02: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
Andrea Canciani
3e9895e951 png: Implement conversion of CAIRO_FORMAT_RGB30 to string
Fixes

png.c:55: warning: enumeration value ‘CAIRO_FORMAT_RGB30’ not handled
in switch
2012-05-26 16:05:07 +02:00
Chris Wilson
f78696249f test: Increase surface size for get-path-extents
Whilst generating a glyph run from a string, any glyphs that are far
outside the surface (including a substantial guard region) are culled.
This affects the path extents. Workaround this by increasing the surface
size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 12:45:54 +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
a845ebe32d test: Fix leak from xcb-snapshort-assert
==12598== 1,344 (768 direct, 576 indirect) bytes in 2 blocks are
definitely lost in loss record 512 of 519
==12598==    at 0x402894D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12598==    by 0x4C76501: _cairo_image_surface_create_for_pixman_image (cairo-image-surface.c:176)
==12598==    by 0x4C76953: _cairo_image_surface_create_with_pixman_format (cairo-image-surface.c:345)
==12598==    by 0x44CFAC: draw (xcb-snapshot-assert.c:36)
==12598==    by 0x40E14C: cairo_test_for_target (cairo-test.c:923)
==12598==    by 0x40EEA7: _cairo_test_context_run_for_target (cairo-test.c:1545)
==12598==    by 0x40BD53: main (cairo-test-runner.c:254)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 12:12:03 +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
Chris Wilson
2d26f7da77 test: Fix tighten-bounds reference images
Uli Schlachter spotted that I had inadvertently committed (606e9e1c9) a
broken set of test images for the tighten-bounds case and so masked a
nasty bug with the mishandling of unaligned clips.

Reported-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
71df65f95a test: Update degenerate-solid-dash reference
Looking at the base output for cairo-1.0 reveals we have an issue with
the placement of degenerate end-caps.
2012-04-29 15:55:16 +01:00
Chris Wilson
ba21231491 test: Fix array lengths for degenerate-solid-dash
The latter arrays were meant to test compaction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 14:23:11 +01:00
Chris Wilson
0c14ce6dca test: Exercise degenerate dashes that are wholly solid
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 13:56:43 +01:00
Chris Wilson
d2f740ccbd test: Exercise clip inversion imperfections
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 12:40:10 +01:00
Chris Wilson
c0b523eb65 stroke(boxes): Convert the dash step back into device units before incrementing
Reported-by: Carlos Garcia Campos <carlosgc@gnome.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-21 10:18:26 +01:00
Chris Wilson
5ff32f70c1 test: Add rectilinear-dash-scale
Exercise rectilinear dashes under a non-uniform scale factors.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48818
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-18 15:29:00 +01:00