The type field is accessible through the base.type field. This makes
it possible to change the layout of cairo_pattern_t and move the type
field without breaking cairo_pattern_union_t.
I updated the Free Software Foundation address using the following script.
for i in $(git grep Temple | cut -d: -f1 )
do
sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done
Similar to the technique used by the other span converters, we can avoid
the frequent error checking by instead throwing an error from the deep
malloc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
_cairo_clip_get_region() returns NULL both for non-region clips and
for memory allocaiton failures. They must be distinguished by checking
_cairo_clip_is_region().
Fixes get-clip.
The brackets defined by push/pop and save/restore are independent ad
should match properly.
This means that cairo_push()-ed gstates cannot be cairo_restore()-d
and cairo_save()-d gstates cannot be cairo_pop()-ed.
Fixes group-state.
The clip surface is no longer cached on the clip and the caller is
responsible for destroying it after use.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The build system does not honor the flags set externally and replaces
it with the pthread-only flags when detecting pthread
availability. This breaks the configuration of cairo in some
cross-compilation environments:
conftest.c:1: note: someone does not honour COPTS correctly, passed 0 times
The test for pthread should append the new flags to the old one.
Currently we only emit the format, but if you want to later convert
the images to a normal surface for replay it is handy to have the
content.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the clip wholly covers the operation, we do not need to set one, and
if the current clip similarly covers the operation we do not to unset
it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the surface already has a clip set and that clip does not interfere
with the operation then we can leave it set.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the extents of the operation is wholly contained within the clip
region, then we can safely not invoke any clipping.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to special case the handling of unaligned clip regions in order
to prevent the treatment of those as a general path requiring a
clip+mask...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A mesh pattern is put in CAIRO_STATUS_INVALID_MESH_CONSTRUCTION when
an invalid patch construction operation is performed.
A mesh pattern is put in CAIRO_STATUS_INVALID_INDEX when an operation
is performed with an out-of-bound index.
Any pattern is put in CAIRO_STATUS_INVALID_MATRIX when its matrix is
set to a singular matrix.
In order to have a behavior which is coherent with that of surfaces,
flushing a finished devices should be a no-op and should not affect
the status of the device.
The replay of the recording surface will not function correctly unless
the target surface region is already clear. So assume that is and
optimise away the initial clear.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Clang static analysis relies on the Core Foundation naming convention
for the object ownership tracking.
Functions that return an object whose ownership is given to the
caller, should contain "Create" or "Copy" in their name.
The code incorrectly initialized the fields of the data structure,
which are about to be overwritten, instead of the temporary variables
which are used to compute them.
This turns the test suite-failures for map-all-to-image map-bit-to-image
map-to-image-fill with xcb-fallback into failed assertions.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Recording surfaces can be unbounded which causes
_cairo_surface_acquire_source_image to return a 0x0 image surface for them.
Since X11 doesn't like anything with a size of 0x0, we should reject such source
images. Users might still try to mess with 0x0 surfaces, so we will eventually
need a better idea for handling this.
Instead of failing the assertion that was added in the previous commit, this
commit makes cairo-xcb return an error.
This makes the recording-* tests fail instead of crash.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Currently, all the recording-* tests fail with an X11 error. This commit turns
those errors into failed assertions. Now someone just has to figure out why this
happens in the first place...
Signed-off-by: Uli Schlachter <psychon@znc.in>
As a recording surface will be replayed onto a destination target, it is
unknown at the time of creation as to whether or not the target is
clear. So we need to make sure to record any initial clear in order
to replay that clear onto the destination. (If the destination is clear
anyway it will be suppressed.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The edge clipper is more complicated than it should be and contains a
subtle bug: when an edge is almost horizontal, it is always considered
as having a positive slope.
Explain what should be done and do it in a simpler way.
Fixes horizontal-clip.