Commit graph

9572 commits

Author SHA1 Message Date
Andrea Canciani
1f2dc2e06a pattern: Do not provide type field in cairo_pattern_union_t
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.
2011-07-31 16:46:36 +02:00
Andrea Canciani
b39d3d4b53 surface: Set errors through _cairo_surface_set_status()
The status should never be set directly. Instead, it should be set by
_cairo_surface_set_status().
2011-07-31 13:05:22 +02:00
Andrea Canciani
ed928c51fb Tighten error validation
CAIRO_STATUS_LAST_STATUS is not an error, it is just the number of
possible status values.
2011-07-31 13:05:22 +02:00
Andrea Canciani
90216cfde0 Update FSF address
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
2011-07-31 13:05:21 +02:00
Andrea Canciani
f6b30686ca Fix make check
This fixes multiple failures when checking if headers can be used
standalone.
2011-07-31 13:05:21 +02:00
Chris Wilson
5e223c1c73 image: Reduce compositing bounded boxes with a clip-mask to a polygon
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-31 08:12:54 +01:00
Chris Wilson
7ca1d87645 tor: Use longjmp to throw an error whilst generating spans
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>
2011-07-31 08:12:54 +01:00
Chris Wilson
1c3b0ebb32 spans: fast-path common case of a single box.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-31 08:12:54 +01:00
Chris Wilson
b231bb0a0b test: Exercise extend modes with recording patterns
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-31 08:12:54 +01:00
Chris Wilson
f3a3c29e2b paginated: Remove an impossible test
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-31 08:12:54 +01:00
Andrea Canciani
c133243111 clip: Fix copy of clip rectangles list
_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.
2011-07-30 10:54:07 +02:00
Andrea Canciani
6155348966 default-context: Do not allow restoring pushed gstates
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.
2011-07-30 09:51:02 +02:00
Chris Wilson
0ae32437af image: Free clip_surface after use
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>
2011-07-29 22:00:10 +01:00
Chris Wilson
2342e4da4f image: extend support of direct replay for paginated surfaces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 18:39:27 +01:00
Andrea Canciani
d2ea8bd070 build: Respect CFLAGS and LIBS env settings
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.
2011-07-29 19:29:53 +02:00
Chris Wilson
b2ee7d9a21 trace: Emit the content type for image surfaces
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>
2011-07-29 17:14:42 +01:00
Chris Wilson
6448022a05 xcb: Convert the box back to integer coordinates for uploading the image
Silly bug of the day.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 16:29:10 +01:00
Chris Wilson
0660f62fe5 gl: Rectilinear fast path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 15:40:47 +01:00
Chris Wilson
c2150b3441 gl: Rectangular fast path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 15:06:20 +01:00
Adrian Johnson
7fbe430e2a ps: remove unnecessary flush
that was preventing string of glyphs from separate calls to
cairo_show_glyphs() being merged.
2011-07-29 21:51:04 +09:30
Chris Wilson
488c94220d ps: Apply the clip reduction techniques from pdf
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>
2011-07-29 13:12:48 +01:00
Chris Wilson
ccf67c7d74 pdf: Don't remove the current clip if redundant
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>
2011-07-29 13:06:49 +01:00
Chris Wilson
6ed0c6224b pdf: Remove redundant clip regions
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>
2011-07-29 13:03:59 +01:00
Chris Wilson
29a302cc4b clipper: Also need to guard against the incoming clip being NULL
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 12:57:31 +01:00
Chris Wilson
fb9ed9bb0d clip: Fix clip-equal to handle one or the other being NULL/all-clipped
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 12:36:21 +01:00
Chris Wilson
7c6e1b8db8 xcb: Short-circuit multiplying the alpha mask by 1.0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 12:36:21 +01:00
Chris Wilson
4032c86127 fallback: Prevent recursion when combining with the clip
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>
2011-07-29 12:36:21 +01:00
Andrea Canciani
2787ef4e73 pattern: Complete the list of possible pattern errors
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.
2011-07-29 13:17:17 +02:00
Chris Wilson
c1b0e73578 record: Only reduce fill+stroke if the clip doesn't change between the commands
Pointed out by Adrian Johnson.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 12:07:09 +01:00
Andrea Canciani
6ec24760b3 device: Flush on a finished device is a no-op
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.
2011-07-29 13:01:59 +02:00
Chris Wilson
74a86a76a9 clipper: Detect a incremental change in the general clip-path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 11:58:07 +01:00
Chris Wilson
aac9b26176 clip: Fix cairo_clip_equal()
In haste, I completely removed the implementation...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29 11:44:21 +01:00
Chris Wilson
ecafad7149 record: Assume recording surface targets are clear
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>
2011-07-29 11:44:21 +01:00
Andrea Canciani
81efbc1847 quartz: Silence some clang warnings
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.
2011-07-29 12:07:06 +02:00
Andrea Canciani
93c8b1090b cff-subset: Do not use garbage values
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.
2011-07-29 11:56:40 +02:00
Andrea Canciani
ad3ef3a8fb Silence Clang static analyzer reports
Clang static analysis triggers some reports in non-buggy code.

Silence them trying to follow better coding practices.
2011-07-29 11:54:56 +02:00
Andrea Canciani
e8e765605c Silence gcc warnings 2011-07-29 10:51:19 +02:00
Andrea Canciani
15b6b2832b directfb: Unbreak compilation
The recent changes to the clip code caused build failure in directfb.
2011-07-29 10:51:19 +02:00
Andrea Canciani
89cb071d14 script: Initialize recording extents
The 2-arguments recording operator was passing a garbage pointer to
the surface creation function.

Spotted by the clang static analyzer.
2011-07-29 10:42:06 +02:00
Uli Schlachter
e06a3b9761 xcb: Handle fallback in map_to_image
Fixes (for xcb-fallback): map-all-to-image map-bit-to-image map-to-image-fill

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-29 10:29:47 +02:00
Uli Schlachter
27702768bf xcb: _get_image only works without fallback
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>
2011-07-29 10:18:55 +02:00
Uli Schlachter
1beab6cca4 xcb: Handle deferred clear in map_to_image
Fixes: map-all-to-image map-bit-to-image map-to-image-fill

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-29 10:10:42 +02:00
Uli Schlachter
8f8149a207 xcb: Error on 0x0 source surfaces
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>
2011-07-29 09:23:15 +02:00
Uli Schlachter
5d72e59982 xcb: Assert that pixmap sizes are positive
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>
2011-07-29 09:23:15 +02:00
Chris Wilson
ec74912eee record: Recording surfaces need an explicit clear
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>
2011-07-28 17:21:33 +01:00
Chris Wilson
65e13cd201 record: We can only skip the clear so long as we know the destination is clear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-28 17:16:25 +01:00
Andrea Canciani
d7abdab931 polygon: Fix generic case of edge clipping
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.
2011-07-28 18:11:27 +02:00
Andrea Canciani
6aa6b7daa8 polygon: Simplify code for edge clipping
Add some comments about what's going on and clean up the branches by
sharing common computations.
2011-07-28 18:11:27 +02:00
Andrea Canciani
de25fec06b test: Improve horizontal-clip
The bug pointed out by this test now causes failures in xcb and xlib.
2011-07-28 18:11:27 +02:00
Andrea Canciani
80b7a1aa9b test: Update image references
Makefile.refs was missing some images.
2011-07-28 18:11:27 +02:00