Commit graph

11117 commits

Author SHA1 Message Date
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
2144e7f48b test: Fix coverage-abutting
Using CAIRO_OPERATOR_OVER in case causes oversampling of the coincident
edges, to measure coverage we should only use ADD. :|

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 16:18:34 +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
ff23afd5f2 test: Include coverage in the normal test run
Currently coverage is marked as slow. It is slower than the typical
test, but it is quite a useful check on our rasterisation quality
without going too far overboard (unlike partial-coverage!).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30 12:25:56 +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
Ravi Nanjundappa
573ddfc3d5 src: check the surface backend for NULL
This is a follow-up patch on top of 150c1e7044
As discussed in the mailing list, http://lists.cairographics.org/archives/cairo/2014-September/025647.html,
check if the surfaces are of particular backend type or not, before proceeding further.

These changes are based on _cairo_surface_is_xlib() and _cairo_surface_is_image()

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-09-29 15:59:26 -07:00
Chris Wilson
06b9f8fa2d stroke,traps: Emit join without loss of precision
As the target renderers operate at a different sample resolution then we
use internally for coordinate representation, there is always a potential
for discrepancies in the line gradients when passing around trapezoids.
To overcome this, the protocol specification of trapezoids uses the full
lines and vertical range as opposed to vertices and so long as we always
use the same lines for conjoint trapezoids, they remain abutting in the
rasteriser.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84115
Testcase: bug-84115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-29 08:42:17 +01: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
Marc-André Lureau
fbb0a260b7 build-sys: do not try to build util/sphinx on Windows
glib and dlfcn exist on windows, but sphinx code uses a lot of
Unix-only API

Fixes the following build error on mingw-fedora

  CC     cairo-boilerplate-system.lo
../../../util/cairo-sphinx/sphinx.c:8:22: fatal error: sys/mman.h: No such file or directory
compilation terminated.

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=63043
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-09-24 12:20:53 -07:00
Bryce Harrington
42320793aa sphinx: Add ickle's explanation of what sphinx does 2014-09-24 12:12:47 -07: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
Chris Wilson
06a737b74d arc: Insert the initial point on the arc
Currently the very first point on the arc will be the first interpreted
location along the spline used to approximate the arc. This will be
close, but not quite the exact point the user intended the arc to run
from, so begin the arc with a line-to the initial point.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 12:35:47 +01:00
Bryce Harrington
bdd0721dcd NEWS: Revise downscaling feature description
Updated feature description using text from Bill.  Also updated bugfix
list to include recent fixes.
2014-09-23 16:41:36 -07:00
Bryce Harrington
7cfebce152 build: Fix float endian configure test when using clang -O4
When using clang -O4, the compiled test object is output in bitcode
format rather than as an ELF object, so when we grep the test value from
the object it fails.  To work around this, go ahead and link the test
object into an executable, and then grep against this native binary
instead of the compiler's intermediary object.

We need to add __attribute__((used)) to ensure the d variable doesn't
get optimized out during linking, since it's not referenced in the
test's main().

Patch authored by cmuelle8 <abendstund@gmail.com>

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=63310
2014-09-23 12:40:25 -07:00
Adrian Johnson
9a19ef1858 Fix compilation with bionic libc
Refactor out a cairo_get_locale_decimal_point() routine to handle a case
where localeconv() is not available.

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=70492
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>

[edit:  Condensed cairo_get_locale_decimal_point and conditionalized
locale.h inclusion.  -- bryce]
2014-09-23 11:40:03 -07:00
Bryce Harrington
a02e29a12d Don't return NULL to clients when getting device
Return an error device instead

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=58061
2014-09-22 15:48:49 -07:00
Bryce Harrington
150c1e7044 Don't return NULL to clients when getting image
Return an error surface instead.

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=58061
2014-09-22 15:41:24 -07:00
Bryce Harrington
40e7576796 NEWS: Note that downscaling changes only affect image + fallback 2014-09-22 15:06:54 -07:00
Bryce Harrington
402b456a32 gl: Increase default VBO size on GL to 1M
The default VBO size was reduced from 256k to 16k because embedded
devices had trouble with the larger memory demands of a big VBO.  My
testing[1] indicates this incurred a 5% performance loss on at least one
of Cairo's performance tests.  Further testing showed that with
late-model graphics cards, further performance benefits can be seen with
even larger VBO sizes, up to 8.3% at 1M for Intel.

Now that we can set the vbo size differently for different backends, set
it to the lower value (16k) for EGL, and higher (1M) for GL.

1: http://www.bryceharrington.org/wordpress/2013/08/vbo-size/

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-09-19 17:23:50 -07:00
Bryce Harrington
aa820c13d7 gl: Track the VBO size as a property of the ctx
Change suggested by Chris Wilson.  This will enable setting different
vbo sizes for GL vs. EGL.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-09-19 17:23:50 -07:00
Bryce Harrington
036f47c345 cairo-gl: Make VBO size run-time settable
The default VBO size was reduced from 256k to 16k last year in commit
90860241 due to problems with larger VBOs on embedded hardware.
However, that change resulted in a 5% performance impact to the
firefox-fishbowl benchmark when using the spans or traps compositors.

This patch doesn't change the VBO size, but does permit it to be
altered via an environment variable, to facilitate testing.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-09-19 17:23:50 -07:00
Ravi Nanjundappa
8479b60867 test: Add test oversized egl surfaces
This test exercises error scenario when creating over sized egl surface
that is larger than maximum framebuffer or texture dimensions of the
context

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-09-19 15:46:14 -07:00
Bryce Harrington
3d68352e3c NEWS: Drop unfinished thought 2014-09-18 13:18:48 -07:00
Bryce Harrington
54670ec13d AUTHORS: Add Ravi, myself, and a couple other frequent contributors 2014-09-17 20:33:22 -07:00
Bryce Harrington
33a54e7c20 README: Update required dependencies
Also adds mention of the skia backend.
2014-09-17 20:25:37 -07:00
Bryce Harrington
d1fa4d44fe NEWS: Bring up to date with recent bug fixes. 2014-09-17 20:04:01 -07:00
Bryce Harrington
e0c0a673ee Disable font options for xcb.
This patch makes a bunch of tests pass again. The first hunk one fixes a
shameful oversight (whoops), the second one effectively reverts
e691d242.  That change broke 102 xcb and 70 xlib tests, including a
bunch of *twin-antialias-* test cases.  Patch thanks to Uli Schlachter.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-09-17 17:30:04 -07:00
Adrian Johnson
0aa43ed886 win32 printing: fix image scale when GDI scale is not identity 2014-09-14 22:02:12 +09:30
Lukáš Lalinský
e691d242d5 xcb: Initialize font options from Xft resources
There is a similar code in the Xlib backend. The logic here is the same, but
XCB doesn't support X resources directly, so there is some custom code
to get and parse the resources from the root window.

Signed-off-by: Lukáš Lalinský <lukas@oxygene.sk>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-09-12 18:19:44 +02:00
David Weiß
e77d0a5611 made paths to pixman, libpng and zlib configurable by commandline for win32 builds
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-09-11 13:00:13 -07:00
Ravi Nanjundappa
3b9d7e583f qt: Suppress warnings in qt backend build
This patch fixes majorly 2 kinds of warning issues:

(1)
cc1plus: warning: command line option '-Wold-style-definition' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wnested-externs' is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [enabled by default]

Solution: Enable these warnings only for C compiler and not for C++

(2)
cairo-qt-surface.cpp: In function 'cairo_int_status_t _cairo_qt_surface_fill(void*, cairo_operator_t, const cairo_pattern_t*, const cairo_path_fixed_t*, cairo_fill_rule_t, double, cairo_antialias_t, const cairo_clip_t*)':
cairo-qt-surface.cpp:852:5: warning: inlining failed in call to 'PatternToBrushConverter::PatternToBrushConverter(const cairo_pattern_t*)': --param max-inline-insns-single limit reached [-Winline]
cairo-qt-surface.cpp:1339:38: warning: called from here [-Winline]
cairo-qt-surface.cpp:390:1: warning: inlining failed in call to 'QPainterPath _ZL10path_to_qtPK17_cairo_path_fixedPK13_cairo_matrix.part.13()': call is unlikely and code size would grow [-Winline]
cairo-qt-surface.cpp:1306:1: warning: called from here [-Winline]
cairo-qt-surface.cpp:1051:5: warning: inlining failed in call to 'PatternToBrushConverter::~PatternToBrushConverter()': call is unlikely and code size would grow [-Winline]

Solution: Add __attribute__ ((noinline)) to the function as mentioned in
http://stackoverflow.com/questions/11724235/warning-for-template-with-g-o2-or-os-o-o1 (Edit 3)

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-09-11 12:53:05 -07:00
Maks Naumov
29a8b4e970 Fix _cairo_mesh_pattern_equal() when cairo_mesh_patch_t structs are different
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-08-28 13:16:47 -07:00
Maks Naumov
e6bf829d89 Fix font x_scale value in _compute_transform()
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-08-27 21:14:26 -07:00
Ravi Nanjundappa
c6ae5b1976 test: Fix null pointer issue reported by cppcheck static analysis tool
cppcheck analysis tool reports the following issues when run on the
latest Cairo source.

$ grep "(error)"  cppcheck_error_log.txt
[test/pdf-mime-data.c:58]: (error) Possible null pointer dereference: file - otherwise it is redundant to check if file is null at line 53
[test/pdf-mime-data.c:75]: (error) Resource leak: fp
$

The proposed changes fixes the above issues.

And also it does some refactoring to print the appropriate error messages
for each error condition in read_file() function and also to free the allocated
data buffer.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-27 20:39:57 -07:00
Ravi Nanjundappa
52c4f0f2da src: Fix memory issue reported by cppcheck static analysis tool
cppcheck analysis tool reports the following issues when run on the
latest Cairo source.

$ grep "(error)"  cppcheck_error_log.txt
[src/skia/cairo-skia-surface.cpp:245]: (error) Memory leak: surface
$

The proposed changes fixes the above issues.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-27 20:39:49 -07:00
Chris Wilson
a5f51588af traps,xcb: Set the box count after filtering
After converting, the number of boxes should only count the number of
non-zero boxes and forget about the zero-sized boxes we skipped over.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-25 08:55:24 +01:00
Chris Wilson
13a09526d2 traps,xcb: Prefilter zero-area boxes when converting traps
The rectangular tesselation routines rely on the presuming that all the
boxes it has to handle are already filtered to remove empty boxes.

<< /width 800 /height 600 >> surface context
0.0848671 0 0 0.0848671 39.907812 5.608896 matrix transform
8 0 m 12.417969 0 16 3.582031 16 8 c 16 12.417969 12.417969 16 8 16 c
3.582031 16 0 12.417969 0 8 c 0 3.582031 3.582031 0 8 0 c h
clip
16 0 m 8 8 l 16 16 l h
clip
0 0 16 16 rectangle
fill

Triggers the error given a traps tesselator like cairo-xlib.

Reported-by: Henrique Lengler <henriqueleng@openmailbox.org>
Analyzed-by: Massimo <sixtysix@inwind.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 14:20:43 +01:00
Uli Schlachter
545444ec1f xcb: Correctly check for image surface for inplace upload
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82987
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-23 14:38:36 +02:00
Maks Naumov
183ac1889f Fix width and height args for _cairo_xcb_connection_copy_area()
Found via static analysis.

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by:  Uli Schlachter <psychon@znc.in>
2014-08-21 12:56:42 -07:00
Ravi Nanjundappa
eab218d1e3 configure.ac: configuration check to enable either gl or glesv2, not both at the same time
A proposed solution for the discussion in
https://bugs.freedesktop.org/show_bug.cgi?id=57379#c12,
to avoid muliple definition of cairo_gl_* symbols when
both gl and glesv2 backends are enabled at the same time

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-08-21 12:34:10 -07:00
Rodrigo Rivas Costa
932548ef25 win32 print: fix cache_frozen assertions
Bug 81709
2014-08-19 00:09:50 +09:30
Ravi Nanjundappa
7736d08e22 README : Update README file related to usage of FORMAT make variable
Reformatted the README file to simplify the sentences.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 16:10:14 -07:00
Ravi Nanjundappa
c61aeddc44 test: improve selective execution of Cairo tests based on FORMAT option
This patch improves the patch "test: Selective execution of Cairo tests based on FORMAT option"
by extending the usage of FORMAT option even in the case of user not
providing TARGETS= option

For ex:
(1). CAIRO_TESTS="zero-alpha" make test FORMAT=rgba
This command runs the zero-alpha test for all the backends with
argb32 content format and so on.
(2). CAIRO_TESTS="zero-alpha" make test FORMAT=rgba,rgb
This command runs the zero-alpha test for all the backends with
argb32 and rgb24 content formats.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 16:10:09 -07:00
Ravi Nanjundappa
f8e0ecb5af test: Selective execution of Cairo tests based on FORMAT option
Added a new command line option FORMAT which can take rgb and/or rgba
values which enables the execution of tests only for the given FORMAT
For ex:
(1). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba,rgb
This command runs the zero-alpha test for both ps2 and image backends
with argb32 and rgb24 content formats.
(2). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba
This command runs the zero-alpha test for both ps2 and image backends
with argb32 content format and so on.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 16:09:20 -07:00
Bill Spitzak
1d9f4ae520 V5: Use NEAREST filter when possible
(changed to use determinant funciton and remove debug printf)

Modifies _cairo_matrix_has_unity_scale to return true for 90 degree rotations
by allowing error caused by inaccuracy in trig functions.

This fails after 14 additions of M_PI_2 to itself as a float argument to
cairo_rotate, but the failure is in the detection of the integer translate,
not in the trig components. I believe this is due to the matrix inversion,
which may need similar rounding.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-08-14 12:59:07 -07:00