Commit graph

4556 commits

Author SHA1 Message Date
Chris Wilson
7fb0d5e209 [twin] Initialise all properties
Left a couple of uninitialised properties along the non-toy font
construction path.
2009-09-09 01:45:16 +01:00
Chris Wilson
4b221bd49a [spans] Correct offsets for trapezoids
Pass on the destination offset from composite_trapezoids() to
composite_polygon().
2009-09-08 19:02:04 +01:00
Chris Wilson
9389cb78a8 [build] Improve handling of missing test apparatus
Improve detection, reporting and disabling of test backends when we lack
the required libraries and utilities.
2009-09-08 17:51:33 +01:00
Chris Wilson
45759e5a0f [gl] Supply extents for acquire source image
I have no idea how we survived for so long without supplying the source
extents...
2009-09-08 09:19:53 +01:00
Chris Wilson
67d40e5c73 [xlib] Protect ourselves from liars that claim to have a 64k window
Found using webkit, who attempt to paint an width X page height window.
Please, please clip large windows to the visible area. Thanks.
2009-09-06 10:21:00 +01:00
Chris Wilson
310cebf194 [configure] Add option to disable trace.
Some environments may be broken beyond our capabilities to detect, or
maybe the user is just insane and doesn't want to build my nice shiny
cairo-trace. Whatever, give them the option to choose:

  $ ./configure --disable-trace
2009-09-05 15:21:50 +01:00
Chris Wilson
402a053948 [gl] compile fix.
Compiled fine during testing -- only I forgot I hadn't enable the gl surface.
2009-09-04 09:47:10 +01:00
Chris Wilson
b065303740 [xlib] Enable pad_reflect by default
If the XServer claims to support the required Render extension then send
it the operations. However for the cases where we know it does not work,
i.e. the current and previous generations (<=1.6) of Xorg servers, enable
the buggy_pad_reflect fallbacks.
2009-09-04 09:35:22 +01:00
Chris Wilson
de99f84188 [fallback] Only eliminate the clip if the operation is bounded
For unbounded operations we still need to pass along the clip in order to
correctly limit the extents of the operation.
2009-09-04 08:55:19 +01:00
Chris Wilson
00ca0780b8 [win32] Remove unused clone_similar()
The win32 backend handles surface sources directly and never calls
_cairo_pattern_acquire_surface() which is the only other possible user of
clone_similar().
2009-09-03 23:25:53 +01:00
Chris Wilson
535bcaa1a1 [mutex] Hook into pthread last
Check for native mutex types before hooking into pthread, as this
workarounds broken builds on mingw that confuse us by including the
pthread header file.
2009-09-03 20:12:41 +01:00
Chris Wilson
769f4a4f47 [gl] Allocate small number of rectangles on the stack
FillRectangle is most frequently used to fill an entire imagee with the
background colour, i.e. with just a single, or few, rectangle. Avoid
heap allocation for this common case by allocating enough space for 4
rectangles (vertices+colors) on the stack.
2009-09-03 20:12:41 +01:00
Chris Wilson
6ce200da9d [gl] Assert that the error is impossible.
As we created the image, it should not need coercing into a suitable
format and so we should be able to upload it without failure.
2009-09-03 20:12:40 +01:00
Chris Wilson
d3aeafb406 [gl] Remove reference to depth_stencil_tex
We no longer use a depth-stencil, so remove the vestigial reference.
2009-09-03 20:12:40 +01:00
M Joonas Pihlaja
9e45673e19 [image] Check for out of bounds image surface sizes in constructors.
The image surface code doesn't reliably work on images larger than
32767 in width or height.  This patch makes the image surface
constructors fail by returning a surface in the CAIRO_STATUS_INVALID_SIZE
state when given negative or too large dimensions so that client code
gets a prompt and correct error rather than flaky rendering on large
images.
2009-09-03 19:27:24 +03:00
Chris Wilson
a76c36f2ed [xlib] solid pictures should only be 1x1
Creating an widthxheight solid picture for using with
RenderCompositeTrapezoids defeats the optimization with the xserver that
checks for a solid alpha pattern. The checks it performs are for
CONTENT_ALPHA, Repeat, 1x1 and value == 0xff.
2009-09-03 14:29:20 +01:00
Chris Wilson
df067be863 [polygon] Compute the limit of the limits slightly more efficiently
Initialize the bbox to the first limit, as frequently there will only be a
single (or at least a small number) limit.
2009-09-03 10:07:34 +01:00
Chris Wilson
a1bac73f24 [boilerplate] Handle errors whilst creating GL surface 2009-09-03 09:22:23 +01:00
Chris Wilson
f1d284f997 [polygon] Fix discard with non-banded disjoint clip boxes
The early discard checked if the line was below the last clip-box, or if
above the first. However, the clip-boxes are only sorted on by the bottom
(not the strict XY-banded sort of the regions) and so this was erroneously
discarding lines.
2009-09-03 01:00:59 +01:00
Chris Wilson
17cdffafda [xlib] Remove stray code
Grr. Should have spotted this before pushing - remove the addition of the
superfluous code.
2009-09-02 00:41:18 +01:00
Chris Wilson
59c4fe93ee [xlib] Eliminate GC clipping
Eradicate the use of clipping with GC. By never using clipping, we never
have to worry about retrieving a dirty clip from the GC cache.
2009-09-02 00:34:37 +01:00
Chris Wilson
7d1eb259f9 [xlib] Make xlib_display_t private and rename xlib_screen_info_t
The issue Joonas was trying to solve was the unwanted inclusion of
the inlines via cairo-freelist-private.h. Unwittingly he included
cairoint.h from cairo-xlib-private.h instead, a far more heinous crime as
that causes the boilerplate to try to use the hidden, private symbols.
Instead we resolve this issue by making the cairo_xlib_display_t structure
private to cairo-xlib-display.c and provide functions to manipulate the
abstract data type. Whilst in the vicinity, we rename
cairo_xlib_screen_info_t to cairo_xlib_screen_t for consistency and
cleanliness.
2009-09-01 23:12:43 +01:00
Chris Wilson
b8ddd66cf6 Revert "[freelist] Make _cairo_freepool_alloc_from_new_pool static inline."
This reverts commit 5a3fa29b37 as it breaks
the boilerplate when linking with gcc.
2009-09-01 21:49:01 +01:00
M Joonas Pihlaja
5a3fa29b37 [freelist] Make _cairo_freepool_alloc_from_new_pool static inline.
The xlib boilerplate includes a cairo private header to be able
to disable usage of the render extension.  This indirectly includes
cairo-freelist-private.h which contains a bunch of static inline
functions which use the private _cairo_freepool_alloc_from_new_pool
function, but since that is not inline also, it causes an undefined
extern which cannot be resolved.  The binutils linker doesn't care
since the freelist function aren't actually used in the boilerplate
but the Solaris linker does.  By making the .._alloc_from_new_pool
function inline no dangling references are created and linking
succeeds.
2009-09-01 23:30:56 +03:00
M Joonas Pihlaja
68c8eb955d [wrapper] Avoid a void return gccism.
Returning void using the pattern "return func_returning_void(...)"
is a gccism not supported by Sun Studio 12.
2009-09-01 23:30:56 +03:00
Chris Wilson
6ddab64025 [ps] Clip meta-surface to desired extents.
Ensure that the meta surface does not extend beyond the operation by
forcing a clip to the extents of the operation.

Fixes test/device-offset and test/device-offset-positive
2009-09-01 20:25:53 +01:00
Chris Wilson
665f582954 [ps/pdf] Trim patterns to operation extents
If we have to rasterise a pattern for use by PS/PDF (for example, to
satisfy CAIRO_EXTENT_PAD) then only generate an image large enough to
cover the operation extents. We ensure tight coverage by computing the
extents afresh - we could do this lazily in the future, but we can not
rely on the bounds as computed by the analysis surface as for native
operations they may not be tight.
2009-09-01 18:24:42 +01:00
Chris Wilson
e7a118d3f8 [path] Standalone header-compilation
Hmm, TRUE/FALSE apparently weren't defined before use. Odd.
2009-09-01 14:31:38 +01:00
Chris Wilson
4f880deeab Compiler warnings
Add an impossible default condition to avoid a compiler warning. And tweak
the code to avoid mismatching signed/unsigned comparisons.
2009-09-01 14:24:59 +01:00
Chris Wilson
1bcc3a3fa0 [tee] Rename 'append' to 'add' and add symmetric 'remove' 2009-09-01 14:24:06 +01:00
Chris Wilson
af82670dd3 [pattern] Remove unused hidden symbol for cairo_pattern_status() 2009-09-01 13:31:52 +01:00
Adrian Johnson
aca1dff259 PDF: Ensure operator is selected before painting surface 2009-08-31 23:13:32 +09:30
Adrian Johnson
a402bdbd32 PDF: Flush operators before writing to the PDF stream 2009-08-31 23:13:32 +09:30
Adrian Johnson
119355b2a4 PDF: Reset alpha to 1.0 before painting a surface
Fixes a test suite regression.
2009-08-31 23:13:32 +09:30
Adrian Johnson
135912721f PDF: Avoid using patterns when filling a surface with EXTEND_NONE
The fill equivilant of the previous optimization.
2009-08-31 23:11:05 +09:30
Adrian Johnson
6512faeb94 PDF: Avoid using patterns when painting surfaces with EXTEND_NONE
This is an optimization the PS surface has been using to improve
printing speed and prevent printers from choking on large
images. Applying this optimzation to PDF prevents the same problem
occuring when the PDF is converted to PS.
2009-08-31 23:11:04 +09:30
Adrian Johnson
26d568a9ad PDF: Fix bug when when embedding surfaces 2009-08-31 23:11:04 +09:30
Chris Wilson
a6bcb6260e [bo-rectangular] Fix assertion failure with insertion sort
We remember the location of the last insert as the next edge is likely to
be nearby. However, we need to be careful when the pointer rests upon the
HEAD and ensure that we begin the search from the appropriate end.
2009-08-30 10:09:51 +01:00
Chris Wilson
a77f1933af Use the more generic is_box when doing simple extent checks
is_rectangle() is far stricter than is_box(), and is only required for a
very limited set of operations (essentially were the rectangle must
conform to the motion as described by cairo_rectangle). For the general
case where we just want to know whether we have a single rectangular path
that covers a certain area,  is_box() is sufficient.
2009-08-29 17:18:19 +01:00
Chris Wilson
0a548d08b5 [clip] Correctly compute a geometric mask for a rectilinear + arbitrary
Fix up the geometric clipper to handle intersecting a rectilinear path
with an arbitrary path and inspecting the result to see if it becomes a
a region.
2009-08-29 17:16:18 +01:00
Chris Wilson
8a323d7c89 [clip] Apply surface offset when combining with clip mask
In order to correctly combine the clip mask with the compositing mask the
clip path must be offset so that it is relative to the destination
surface.
2009-08-29 17:12:31 +01:00
Chris Wilson
21225a7163 [clip] Pass in destination offset for combining with clip-mask
When combining a clip-mask with a subsurface, as when used to combine with
the composite mask, we need to pass the destination surface offset to the
clip so that the paths can be corrected for the new surface.
2009-08-29 17:10:05 +01:00
Damian Frank
06ca0b1475 Fix build on systems with older Xrender headers.
This patch revises xlib so that it doesn't depend on having recent
Xrender headers to build.  In particular, some definitions were added
to the private xrender header file, and an ifdef render version check
CAIRO_SURFACE_RENDER_SUPPORTS_OPERATOR was changed to a run-time
check using CAIRO_SURFACE_RENDER_HAS_PDF_OPERATORS.
2009-08-29 17:10:05 +01:00
Chris Wilson
155e10e632 [script] Fix use of freed list
A typo, I missed converting the user over to the freshly sorted list,
leaving it iterating over original but checking the sorted for termination
conditions.
2009-08-29 17:07:40 +01:00
Chris Wilson
5393aa6d6c [path] Return the canonical box.
When returning the single box that represents a path, always return it
consistently wound.
2009-08-29 17:07:40 +01:00
Chris Wilson
afea5eb79d [scaled-font] Fix implementation-face refleak
If we found the font via the holdover cache, or if we returned due to an
error, we would leak a reference count on the implementaton face.
2009-08-29 17:07:39 +01:00
Chris Wilson
e5d44937f3 [ft] Improve error path handling.
Specifically check for an error during resolving the font and do not cache
the error object.
2009-08-29 17:07:39 +01:00
Chris Wilson
e76856e6ee [scaled-font] Refleak on error path.
Perform the destroy of the local font before returning along the error
path.
2009-08-29 17:07:39 +01:00
Chris Wilson
d7d6f75ed2 [clip] Fix refleak of previous clipping surfaces.
When combining previous clip masks, we leaked a referenced due to not
destroying the returned reference.
2009-08-29 17:07:39 +01:00
Chris Wilson
20cdb99ae8 [path-fixed] Distinguish cw and ccw boxes
To correctly handle retessellating trapezods constructed from alternately
wound boxes, then we need to pass that information from the path to the
tessellator. We do this by switching the direction of the box if the first
edge is horizontal as opposed to vertical.
2009-08-29 17:07:39 +01:00