Commit graph

10159 commits

Author SHA1 Message Date
Chris Wilson
c7565eeda0 test: Exercise copy/filling unsorted rectangles
Exercise the bug Keith found in the xlib backend, which claimed the
output from the rectangular tessellator would always be sorted.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-06 19:02:45 +00:00
Keith Packard
950021f881 Clip rectangles are not necessarily YSorted
None of the cairo clipping computations guarantee that the resulting
list of rectangles are constructed in any particular order. Promising
that they are results in an X error (BadMatch) which generally causes
applications to crash.

I suspect this may well be implicated in many (many) bug reports about
applications which use cairo.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-06 18:06:28 +00:00
Chris Wilson
d60a2930e1 test: reference ref images after tweaking polygon clipping 2011-12-06 14:56:49 +00:00
Chris Wilson
291efa76de polygon: Tweak the y-coordinates of the edge so that it is inside the clip
As we evaluate the line first using y-for-x to find the clipped
vertical range and then rasterise the line using x-for-y, we can incur
severe rounding errors that cause us to draw beyond the clipped region.
The first simple attempt at a fix is to tweak the clipped vertical range
such that the evaluated extents of the line are contained.

Reported-by: Taekyun Kim <tkq.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-06 14:49:27 +00:00
Chris Wilson
19dd6e7e53 polygon: Assert that we add edges that are wholly contained by the clip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-06 14:44:57 +00:00
Chris Wilson
6b472e12ae gl: Re-enable the CLEAR optimisation
It was temporarily disabled whilst the surface API was in flux.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-06 11:33:15 +00:00
Adrian Johnson
a8cbb00784 pdf: avoid using pdf patterns to paint/fill translucent linear/radial gradients 2011-12-06 20:47:14 +10:30
Adrian Johnson
79f430e7ad pdf: avoid using pdf patterns to paint/fill opaque linear/radial gradients
Patterns are slower and use more memory to print. For painting and
filling we can use the shading operator to draw gradients.
2011-12-06 20:46:49 +10:30
Adrian Johnson
dee48f0dca ps: allow embedding of cmyk jpeg images 2011-12-06 20:46:35 +10:30
Adrian Johnson
74c0a06105 pdf: allow embedding of cmyk jpeg images 2011-12-06 20:46:21 +10:30
Adrian Johnson
25e35b46bf ps: avoid padding images if the padding is not required to fill the extents 2011-12-06 20:45:31 +10:30
Adrian Johnson
c7ce1b68d5 pdf: don't use patterns with padded images
and avoid padding if the padding is not required to fill the extents.
2011-12-06 20:45:14 +10:30
Adrian Johnson
346b8fe398 type1-subset: remove unused variables 2011-12-06 20:44:50 +10:30
Adrian Johnson
ed7157d705 truetype-subset: remove unused variable 2011-12-06 20:44:22 +10:30
Uli Schlachter
3ebe0ca876 xlib-xcb: Implement surface_set_drawable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 22:55:58 +01:00
Uli Schlachter
9ec5e9fee6 xcb: Fixup some internal state in set_{drawable,size}
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 22:48:56 +01:00
Chris Wilson
3dbb0f17a7 gl: Unbreak the glyph cache
Use the embedded operand on the surface instead of copying it across and
trying to then wrap the surface from it - as it would then unref the
glyph cache surface after the operation and so we would lose the glyphs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 18:32:58 +00:00
Chris Wilson
e68eb874e9 fallback: fix the offset for painting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
dd73add00c gl: Set the device offset on map-to-image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
f7daaa8fce gl: Propagate clip region
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
3b1151f60d gl: Substitute the white source for the default pattern
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
0ce8dad9a2 gl: Decouple glyphs on shutdown from the scaled font caches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
31c0726f68 gl: Embed the operand rather than a pattern into the glyph cache
Use the native encoding for patterns.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
16038150b3 gl: Use the embedded operand to allow passing sources around
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
65cd7d3beb gl: Propagate surface texture to embedded operand
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
d7dcf9d28f gl: Check against user-provided invalid sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
3edf369ead gl: Make the backend struct static
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
934a3dcc6b doc: Drop the gtk-doc markup from _cairo_radial_pattern_focus_is_inside
Stop confusing gtk-doc with this private function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:19:48 +00:00
Chris Wilson
aa5a9c46e1 doc: add CAIRO_DEVICE_TYPE_COGL
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:17:18 +00:00
Chris Wilson
4a0913eb52 doc: Add new antialias symbols
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:16:32 +00:00
Chris Wilson
d6440f2d66 script: Add documentation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:12:02 +00:00
Chris Wilson
d86ce9ca2f doc: Add sections for cairo-script
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:35:42 +00:00
Chris Wilson
498ca4bf74 doc: Add similar-image, map-to-image, unmap-image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:51 +00:00
Chris Wilson
9156339295 xcb: Silence a compiler warning for mixing status and internal status enums
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:51 +00:00
Keith Packard
b9d4a5f106 Add cairo_xcb_surface_set_drawable
Mirrors cairo_xlib_surface_set_drawable, allowing the drawable
targeted by a surface to be changed on the fly.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:51 +00:00
Keith Packard
a30013f72a Create XCB documentation.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:50 +00:00
Keith Packard
d5c7d2e2f4 cairo-xcb: gtk-doc doesn't like _ in parameter names
Any function documented with gtk-doc must not have _ in any parameter
names, or at least that's what I've found. This patch simply renames
parameters as needed to make things work.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:50 +00:00
Chris Wilson
a6def3874c gl: Even repeating subsurfaces need to be cloned
As we can't reuse the existing surface definition for a repetition of
the subsurface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:29:51 +00:00
Chris Wilson
f308ba7a44 subsurface: Replace any existing snapshot
Only allow one owner to keep their snapshot on the subsurface, and
so automatically replace any previous snapshot.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:25:38 +00:00
Chris Wilson
03be2019cd gl: And enable subsurface caching of the clones
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:21:18 +00:00
Chris Wilson
5f6d3fe40b gl: Temporarily clone a subsurface as required
When the sample extents exceed the subsurface bounds we need to clone
the subsurface into a regular surface in order to correctly handle the
CAIRO_EXTEND_NONE extend mode (i.e prevent sampling out-of-bounds).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:17:24 +00:00
Chris Wilson
4713562eda trace: Remove the warning about the unstable format
We're stuck with the PostScript style for this generation now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:50:21 +00:00
Chris Wilson
f5f303f10d script: Prefer polymorphorism for mesh path construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:48:50 +00:00
Chris Wilson
8844d50308 Convert cairo_mime_surface_t to cairo_raster_source_pattern_t
As discussed, overloading the cairo_surface_t semantics to include
sources (i.e. read-only surfaces) was duplicating the definition of
cairo_pattern_t. So rather than introduce a new surface type with
pattern semantics, start along the thorny road of extensible pattern
types.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:35:42 +00:00
Chris Wilson
2c4f6bbfbc gl: Prevent the traps compositor from exploding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
5e4a0bd892 gl: Embed a operand into the surface for pass-through
The traps compositor expects to be able to pass either in a surface or a
source to its composite functions, so make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
4cf001244a gl: Avoid cleaning up an uninitialised composite upon UNSUPPORTED
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
5edb3a29b9 gl: Fallback for complex subsurfaces
In the process we need to supply the sampled area and operation extents
into the operands.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
12b8f94161 gl: Correctly offset sub-image uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
e280e67b86 gl: Update glyphs to use cairo_gl_source_t
It was being passed into the function but then interpreted as a
cairo_pattern_t. Fix it!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 21:20:21 +00:00