Commit graph

11149 commits

Author SHA1 Message Date
Adrian Johnson
99a35dd273 CFF: Fix unaligned access
Debian bug 712836 reported bus errors in cff subsetting when
running on a sparc. This is because unlike truetype, all data
in the compact font format is not aligned.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712836
2014-10-19 11:54:25 +10:30
Bryce Harrington
5c17bf1a33 Add execution bit for make-cairo-test-constructors.sh
This is referenced in the Makefile but not set as executable
2014-10-17 15:50:31 -07:00
Adrian Johnson
f05e9332b3 Update mime type documentation. 2014-10-17 22:04:39 +10:30
Bryce Harrington
9102c0b0af RELEASING: Update tags push command
I couldn't get the documented command to do diddly.  Running
`git push --tags` achieved what I think was intended.
2014-10-16 11:41:40 -07:00
Bryce Harrington
92bc5376a8 Start 1.14.1 development 2014-10-13 19:57:09 -07:00
Bryce Harrington
f6fd372a8b pattern: Restore dropped inclusion of cairoint.h
Fixes failure in make release-check due by check-preprocessor-syntax.sh
due to requirement that cairoint.h be the first include for source files.
2014-10-13 18:54:12 -07:00
Bryce Harrington
60ca80b248 1.14.0 release 2014-10-13 18:45:53 -07:00
Bryce Harrington
3e41f7b381 NEWS: Flesh out docs for new APIs 2014-10-13 18:30:23 -07:00
Bryce Harrington
41561c527c NEWS: Update with latest changes and finalize for release 2014-10-13 18:20:45 -07:00
Adrian Johnson
ab2a7b61d5 pdf: don't use '\' to split strings across multiple lines
The PDF interpreter in my printer does not handle this correctly.
So instead we add the string delimiters '(' and ')' to each line.
2014-10-12 21:06:45 +10:30
Bill Spitzak
45934f69cd image: Corrected extents calculations
New implementations of _cairo_pattern_sampled_area and _cairo_pattern_get_extents
which produce a more accurate bounding box. These do not depend on side-effects
of analyze_filter, can handle different horizontal and vertical scales, filters
wider than 1 for down-scaling, and compute a somewhat tighter bounding box
in most cases.

I removed the pad output of _cairo_pattern_analyze_filter as it is unused.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-10 18:09:14 -07:00
Bill Spitzak
3cd7ed1f32 xcb: Use image fallback for GOOD/BEST filters
It will not use the fallback if the symbols in the previous patch
are turned on.

Also some code rearrangement to make this resemble the xlib version
more and to remove some suspect bugs. In particular meshes should not
work just because the translation is an integer.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-10 18:09:09 -07:00
Bill Spitzak
ca9aee4e62 xcb: Add switches for whether XRender supports GOOD/BEST filtering
Currently these are always false, but if XRender use a pixman that
supports filtering these could be turned on for that version.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-10 18:09:05 -07:00
Bill Spitzak
58728da6eb xlib: Use image fallback for GOOD/BEST filters
Fallback is not used if the symbols defined in the previous patch to
indicate if XRender does GOOD/BEST are true.

This patch also includes some changes to take advantage of the fact that
if there is an integer translation analyze_filter will already have set
the filter to NEAREST.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-10 18:09:01 -07:00
Bill Spitzak
c653dcd3e6 xlib: Add symbols to indicate if XRender supports GOOD/BEST filtering
Currently these are always false, but if some version of xlib uses
a pixman supporting filtering they could be changed to return true
for that version.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-10 18:08:56 -07:00
Bill Spitzak
c8b1bf55ad image: Move filter decision to _cairo_pattern_analyze_filter
The analysis to deterimine if the GOOD filter can be replaced with
the BILINEAR filter is moved to this function so it can be used
by backends other than the image backend.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-10 18:08:48 -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
Bryce Harrington
79b5a35f83 test: Add an update-refs.sh script to update reference images
There are cases where the rendered output of a test can vary from
backend to backend in ways which are visually acceptable.  This is why
we have reference images in the first place.  In these cases, changes to
the rendering logic can result in slight differences in the output that
is also within acceptable visual limits.

We see this in the pixman downscaling tests.  This script is introduced
as a way to more easily update the reference images after a renderer
change.

This script is intended to be expanded to handle updating of references
for other tests as we identify similar issues.  The intent is that this
script then serves as a way to document these exceptional cases.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-10-09 18:28:52 -07:00
Bryce Harrington
1570fa23e8 test: Fix error message to specify the executable that was missing
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-10-09 13:51:49 -07:00
Chris Wilson
a8abf3a48b test: Fix conflation of different device scales in index.html
Currently testtable.js does not recognise the difference between running
the same test with multiple scale factors and merges the results into
one.
2014-10-09 10:57:17 +01:00
Chris Wilson
8047179bfc test: Teach check-preprocessor-syntax.sh about -inlines.h 2014-10-09 10:56:28 +01:00
Bryce Harrington
7c1db82a2e Get make check back to a happy spot
Fix header ordering for some recently added code so cairo internal
headers are included first.  Quells two make check errors.

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=84638
2014-10-03 12:34:06 -07:00
Bryce Harrington
f57c0fd465 Declare as private the new cairo_lines_compare_at_y symbol
Fixes a make check error.

  Checking that .libs/libcairo.so has the same symbol list as cairo.def
  126a127
  > cairo_lines_compare_at_y

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=84638
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-03 12:20:13 -07:00
Bryce Harrington
d9ba8337ab quartz: Check for quartz surface type before conversion
Fixes the following warning introduced in a recent commit reported by
~suv:

  CC       cairo-quartz-image-surface.lo
cairo-quartz-image-surface.c:382:37: warning: incompatible pointer types
passing 'cairo_quartz_image_surface_t *'
      (aka 'struct cairo_quartz_image_surface *') to parameter of type
       'const cairo_surface_t *' (aka 'const struct _cairo_surface *')
      [-Wincompatible-pointer-types]
    if (! _cairo_surface_is_quartz (surface)) {
                                    ^~~~~~~
./cairo-quartz-private.h:87:50: note: passing argument to parameter 'surface' here
_cairo_surface_is_quartz (const cairo_surface_t *surface);

References:  https://bugs.freedesktop.org/show_bug.cgi?id=84569
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-10-03 11:55:59 -07:00
Andrea Canciani
03756e042a quartz-image: Fix build
The quartz-image backend uses _cairo_surface_is_quartz(), which
therefore needs to be made available to it. Fixed as suggested by
Bryce in the referenced bugreport.

References: https://bugs.freedesktop.org/show_bug.cgi?id=84569
Signed-off-by: Andrea Canciani <ranma42@gmail.com>
2014-10-03 11:38:48 -07:00
Andrea Canciani
531da6fb91 quartz: Fix build
Cairo cannot build with Quartz enabled since
573ddfc3d5, because of a double
definition of _cairo_surface_is_quartz().

References: https://bugs.freedesktop.org/show_bug.cgi?id=84569
Signed-off-by: Andrea Canciani <ranma42@gmail.com>
2014-10-03 11:38:44 -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
7f7ed4c04e image: Eliminate self-intersections for the pixman traps compositor
As pixman uses an accumulation mask, it oversamples neighbouring edges
within a cell. We can reduce the impact of this by eliminating
overlapping triangles/trapezoids from being passed into pixman.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 09:16:04 +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
950f1e7103 tor: Enable analytic processing for starting rows
If all the edges start at the very beginning of the whole row, we can
merge them and include check for intersections/endings during the row.
This allows us to enable fast analytic processing for even the very
first row on pixel aligned vertices.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 08:46:44 +01:00
Chris Wilson
1a32ce83e4 tor: Perform analytic coverage over the pixel not sample points
We use two different methods within tor to compute the coverage.
The first is that we iterate over every sample point within the pixel
and see if it is covered. The second is that we look at a whole pixel
and analytically compute the coverage inside (if we have no
intersections within that row).

One side effect of

commit 03c3d4b7c1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 30 08:44:43 2014 +0100

    tor: Fix loss of precision from projection onto sample grid

was to compute our X coordinates for the sample locations (offset by
half a subrow) and that in order to compute the analytical pixel
coverage correctly, we therefore need to backstep by half the subrow to
the pixel boundary.

References: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 08:46:44 +01:00
Chris Wilson
79c8b14b9f test/simple: Tighten sanity checks in reference image generator
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
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