This patch has been generated by the following Coccinelle semantic patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it
@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
- free(E);
(
- E = NULL;
|
- E = 0;
)
...
- }
@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
- free (E);
- }
A common requirement is the fast upload of pixel data. In order to
allocate the most appropriate image buffer, we need knowledge of the
destination. The most obvious example is that we could use a
shared-memory region for the image to avoid the transfer cost of
uploading the pixels to the X server. Similarly, gl, win32, quartz...
The other side of the equation is that for manual modification of a
remote surface, it would be more efficient if we can create a similar
image to reduce the transfer costs. This strategy is already followed
for the destination fallbacks and this merely exposes the same
capability for the application fallbacks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
b8f43617a9 regressed the generation of
Makefiles. automake 1.10 fails when executed during ./autogen.sh:
automake: cairo_test_suite_OBJECTS should not be defined
test/Makefile.am:76: while processing program `cairo-test-suite'
A benchmark to test how close we get to reducing paint+clip to an ordinary
fill, and to check correctness.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Not sure what the right results are, so refs will come later. The output
looks superficially right, but the *code* is known to be buggy...
(And hopefully this has captured a few of those bugs.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If I've written the tests correctly, these should produce identical
images as the a1 rasterisation tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
ce3806510f changed the format of
Makefile.refs, breaking the check-ref-missing target.
Ignoring any line not containing a .png file fixes check-ref-missing
and makes it more robust.
Generates the lexicographical Makefile.refs based on the *.ref.png and
*.xfail.png checked into git.
This might be nice to automate as a Makefile target. But for now play
safe and do the updates manually.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The test-antialias-* tests perform the same operation with just a
different antialias flag. Sharing the code ensures that they are kept
in sync and permits adding new flags combinations easily.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14268
The old code considered every even "word" as a key and every odd
"word" as a value when parsing a test log file.
All of the keys end with ':', so restrict with this requirement.
On linux it is impossible to check the missing references because of
argument length constraints:
make: execvp: /bin/bash: Argument list too long
Using a temporary file instead of variable expansion makes it possible
to work around this.
Makefile.refs is now required to be in lexicographical order, which
avoids ordering problems and the risk of duplicated entries (like
clipped-surface.ref.png).
Test targets now explicitly depend on the cairo library and build it
appropriately.
Phony targets depend on inform, so that they print a warning if the
environment is not set up appropriately.
On Win32, the POSIX-compatible unlink function is named "_unlink".
A function named "unlink" exists, but does not have the same behavior
as the POSIX-specified one. This function makes the cairo test suite
behave incorrectly and immediately terminate with the message:
Error: Cannot remove cairo-test-suite.log: No error
51bd27afa1 removed
make-cairo-test-constructors.c but did not update the win32 Makefiles
accordingly.
cairo-test-constructors.c is now generated by a make target which runs
make-cairo-test-constructors.sh.
In commit 532cbcfbc7 'Add unaligned boxes to "operator-source" test', I
removed some reference images from the test suite, but I forgot to also remove
these files from test/Makefile.am. This caused "make dist" to fail.
Thanks to Alexandros Frantzis for noticing this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
These ref images might be wrong. Since the test failed here already before this
change, I took the old ref images and copied the new part from the test output
underneath it. For the backends that I don't have, I deleted the images (sorry).
After this, the "operator-source" test still fails for me on all backends, but
much more prominently so for the image backend. xcb-render-0.0/argb32 gets
compared against a rgb24 ref image, but apparently this was already the case
before(?). The rest are minor differences.
This reveals a bug in the image backend. This was originally reported here:
http://lists.cairographics.org/archives/cairo/2011-March/021827.html
Signed-off-by: Uli Schlachter <psychon@znc.in>
This new test (based on show-glyphs-many) checks that the glyphs
advances are respected along both axes.
9c0d761bfc introduced a bug which
regresses this test in quartz.
Thanks to Jeff Muizelaar for the report!
The ARRAY_LENGTH macro is used by many tests, although sometimes it is
named ARRAY_SIZE. Define it just once in cairo-test.h and reuse it.
In a similar way, MAX() and MIN() are currently defined in some
specific tests, while they could be reused.
warning: cannot optimize possibly infinite loops
gcc does not detect that the "infinite" loops are actually just one or
two iterations, depending on the has_similar value being FALSE or
TRUE. It realizes it if the iteration variable and the iteration stop
value are both enum values.