Commit graph

10072 commits

Author SHA1 Message Date
Uli Schlachter
8025fcc4d3 xcb: Add a special case for recording surface
An unbounded recording surface will complain loudly when you call
acquire_source_image on it and thus we need a special case which draws the
recording surface to a temporary surface and then proceeds with that.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-11 14:04:16 +01:00
Uli Schlachter
420110d12b xcb: Move the surface picture setup into its own function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-11 13:41:39 +01:00
Uli Schlachter
fe04df11ed xcb: Silence compiler warnings about ignored return values
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-11 11:17:06 +01:00
Uli Schlachter
b6fcf0768c xcb: Silence a compiler warning for mixing type and internal type enums
cairo-xcb-surface-render.c:1134:35: warning: comparison between
'cairo_surface_type_t' and 'enum _cairo_internal_surface_type' [-Wenum-compare]

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-11 11:14:58 +01:00
Adrian Johnson
be288ce016 doc: fix typos 2011-12-10 00:40:54 +10:30
Adrian Johnson
c7ea92907a ps: simplify the EPS save and restore
userdict is not permitted in EPS files. Since the PS surface does not
leave extra operators or dictionaries on the stack the EPS prolog and
trailer can be reduced to:

save
50 dict begin

....

end
restore

The save/restore pair is required to remove fonts and restore the
graphics state. As "restore" does not restore the dictionary stack,
using a new current dictionary for the EPS file allows the cairo dict
entries to be cleaned up at the end the EPS.

Bug 43634
2011-12-10 00:39:29 +10:30
Chris Wilson
f446e57f35 gl: Track surface references through operands
In the case where we created a surface to handle an operand, it needs to
be freed when we release the operand. However, we also have to be
careful not to introduce reference cycles into ordinary surfaces, so
always remember to teardown the composite setup!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-09 09:20:23 +00:00
Chuanbo Weng
8d4425053d gl: fix bug in _cairo_gl_surface_embedded_operand_init()
The operand->texture.surface should be set to right value, not
NULL. Otherwise, when doing _cairo_gl_surface_operand_init(),
the texture.surface in operand struct will also be NULL, which
is incorrect. This fix regression suite in 43 test cases(such
as source-clip) in cairo/test/.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-09 09:17:28 +00:00
Uli Schlachter
2a60e8deec xcb: Fix invalid casts from cairo_content_t to cairo_format_t
This was introduced in a69335a84e when the second argument of
_cairo_xcb_surface_create_similar_image was changed from content to format.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-08 22:41:10 +01:00
Chris Wilson
d828c724c0 gl: Decouple the glyph upon eviction
In order to decouple the texture node from the scaled glyph cache, we
need to add a callback from the rtree for when the node is removed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-07 18:00:18 +00:00
Chris Wilson
98335b4390 doc: Add documentation for cairo_raster_source_pattern
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-07 13:33:47 +00:00
Chris Wilson
cff0097954 gl: Prevent leak of the white source used with glyph masks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-07 11:58:39 +00:00
Chris Wilson
5613b210ff gl: Defer stencil allocation until use
Allocating a stencil and a depth buffer for every destination surface is
simply too expensive and causes major resource issues. So defer the
allocation and attachment of a stencil buffer until just prior to first
use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-07 10:22:25 +00:00
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