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)
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>
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>
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]
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>
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]
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>
The lookup of the string names has significant overhead, which is why GL
gives you glGetUniformLocation so that you reference uniforms by
constant integers in your high performance path.
Reduces cairo-perf-trace runtime of firefox-planet-gnome by 1.06767% +/-
0.289265% (n=72) on my IVB macbook air.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
The test-traps and test-base surfaces are used for generating the
reference results, and so they should opt for using the best rendering
paths through the traps- and base-compositors.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Edward Zimmerman pointed out that the xml surface had bitrotted slightly
and no longer understand the new clip layout - in particular that we can
have clips without a path, but just with boxes instead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As a first step towards bring SVG uptodate with the various new
patterns, first we need to prevent SVG crashing when it mishandles an
unknown recording surface.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We can skip the intermediate evaluation of the trapezoids for
determining the extents of a stroked path by using the relatively new
functions for computing the contours of the stroke. Then we can simply
use the bbox of the points within the contours to retrieve the path
extents - which is already provided by the polygon holding the contours
of the stroke. This provides a faster result with less numerical
inaccuracy due to fewer stages required in the computation
References: https://bugs.freedesktop.org/show_bug.cgi?id=62375
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
Victor Goya found that we ended up leaking memory after reading a PNG
into an image surface and drawing that onto a PDF surface. In
particular, he discovered that
commit 0bfd2acd35
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Aug 13 01:34:12 2012 +0100
xlib: Implement SHM fallbacks and fast upload paths
introduced a path to steal the image data for a snapshot (and thereby
avoid a redundant copy), but that path then lead to the leak of the
"owned" data.
Reported-by: Victor Goya <victor.goya@af83.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
cairo-pdf-surface.c: In function '_cairo_pdf_surface_add_source_surface.isra.20':
cairo-pdf-surface.c:1461:10: warning: 'unique_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
mask is a cairo_surface_t pointer, and is cast to a cairo_gl_surface_t
pointer in the _cairo_gl_surface_draw_image() call.
texture.owns_surface also expects mask to be a cairo_gl_surface_t
pointer, so apply the same cast here as well.
Fixes the following warning:
cairo-gl-traps-compositor.c:370:35: warning: assignment from
incompatible pointer type [enabled by default]
Ref.: 38bf7a65
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
There are only three possible color states: COLOR, GRAYSCALE, or
MONOCHROME thus data and data_size will always be set to some value,
so assert the default is never reached.
Fixes these warning:
cairo-pdf-surface.c:2517:32: warning: ‘data_size’ may be used
uninitialized in this function [-Wuninitialized]
cairo-pdf-surface.c:2338:19: note: ‘data_size’ was declared here
cairo-pdf-surface.c:2446:11: warning: ‘data’ may be used uninitialized
in this function [-Wuninitialized]
cairo-pdf-surface.c:2337:11: note: ‘data’ was declared here
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Since we explicitly set font->subset_subrs to false, there's no way the
warned code will be executed, but perhaps the compiler is confused by
the goto jump.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
If we fail to create a glyph, and it is the only one in the glyph page,
we then pluck that page out of the global glyph cache. The cache destroy
callback tries to take the scaled_font lock again, causing a lockup.
Rework the error path to avoid taking that lock in this case - still a
potential lock ordering issue remains.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we try to sort a zero length array, we access invalid memory.
However, for a zero length command array, we can trivially compute the
number of visible indices, 0.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we have more rows than the max_count in any column, we end up
stretching the histogram vertically, which makes it harder to read.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If running ./cairo-perf-print in a terminal, query the terminal size and
rescale the histogram to use the maximum available space.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If you call ./cairo-perf-print --histogram results.txt, it will then
print a histogram of the results, one per test. Ideally, you should see
a skewed distribution (with a negative skew representing that most results
run in optimal time), but random sampling errors (scheduling,
throttling, general inefficiency etc) will push it more towards a normal
distribution.
For example,
| x |
| x xx |
| x xx |
| x xx |
| xxxx |
| xxxx x |
| x xxxxxx |
| x xxxxxx |
| xxxxxxxxx |
| xxxxxxxxx |
| xxxxxxxxx |
| xxxxxxxxxxxx |
| xxxxxxxxxxxx |
| xxxxxxxxxxxx |
| xxxxxxxxxxxxxx |
|x xxxxxxxxxxxxxx |
|x x xxxxxxxxxxxxxxx |
|x x xxxxxxxxxxxxxxx |
|x x xxxxxxxxxxxxxxxxx |
|xxx x xxxxxxxxxxxxxxxxxxx |
|xxx xxxxxxxxxxxxxxxxxxxxxxxxx |
|xxxxxx xxxx x x x x xxx xx xxxxx xxx x xxx x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
.------------------------------------------------------------------------------.
xlib firefox-fishtank 8298.44 1.53% (829/946)
Starts off reasonably, but quickly deteriorates as the integrated CPU/GPU
overheats and is forced to throttle.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We were wantonly mixing unsigned/signed integers for our index and
counters, leading to compiler warnings. Be bold, and use unsigned
consistently.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
In particular fixing up a couple of corner cases in emitting the right
instructions for scaled-fonts and patterns.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Otherwise we leave dangling pointers in the visual list, leading to
memory corruption when using low bitdepth servers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to be more careful when trying to discard a clip to be sure that
it is truly not required. In particular, we need to not throw a way a
clip region when it has more than one box intersecting the mask.
Reported-by: Alexander Larsson
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=697357
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Make _cairo_gl_context_bind_framebuffer handle different types of GLES
surfaces properly Since, the multisampling setting of a surface never changes
in for GLES, so the first thing we do when setting the destination is to
ignore the requested multisampling setting. This simplifies all
following logic.
Fix more fallout from separating framebuffer binding from setting the
destination. In some cases it is sufficient to call
glDrawBuffer/glReadBuffer before binding the framebuffer, but the
masking-filling-stroking test of cairo-gl-smoke-tests fails if the order
is incorrect.
Disentangle the action of binding the framebuffer from setting the
destination. This straightens up the code a bit and avoids some redundant
operations (such as reacquiring the context) when simply switching from
the multi-sample framebuffer to the single-sample framebuffer and vice
versa.
When flushing a surface, we must resolve multisampling for desktop GL.
This allows use of the original surface texture in any following raw GL
operations. This fixes accelerated canvas with WebKitGTK+ using the MSAA
compositor.
It turns out that libpng will continue to load an image after throwing a
warning, and that libpng16 now throws warnings for images that libpng15
and earlier loaded without error. As we were happily loading those
images into cairo surfaces before, we are therefore being overzealous
in throwing an error now - so just squelch the warning.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Once upon a time the wrapping was provided by the caller, but the
current requirement is that the error is propagated back as an error
surface.
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=63196
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>