Commit graph

4537 commits

Author SHA1 Message Date
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
Chris Wilson
219d46a9eb [scaled-font] Eliminate intermediate path when tracing glyphs
Currently the tracing code for glyphs constructs an temporary path in
order to replay and append to the output. This temporary allocation is
extremely wasteful as we can just directly append the glyph path to
the output path.
2009-08-29 17:07:38 +01:00
Chris Wilson
2e05922737 [stroke] Handle degenerate stroke extents
If the stroke is degenerate, i.e. the path consists only of a single
move-to and no edges, then the stroke may be visible due to end-capping
(as opposed to fills which are empty). So we also need to pad out the
extents around the current point for the degenerate case.
2009-08-29 17:07:38 +01:00
Chris Wilson
cfd78393f3 [path] Handle the implicit close for path_fixed_is_box()
_cairo_path_fixed_is_box() is only called for filled paths and so must
handle the implicit close (which was already being correctly handled by
_cairo_path_fixed_iter_is_box).
2009-08-29 17:07:38 +01:00
Chris Wilson
f22045bb4b [fallback] Include implicit closes in the check for rectilinear paths
Fixes test/implicit-close

By forgetting the implicit-close when checking for rectilinear paths, we
tried to feed the triangle (and other diagclose) into the specialised
rectilinear tesselators which completely mishandled that final edge.
2009-08-29 17:07:38 +01:00
Chris Wilson
fcda9fc2f2 [scaled-font] Remove assert from cairo_scled_font_create()
The assert() is only correct for the normal paths, but failed on the error
path. It has been run for long enough for me to be confident that the code
is self-consistent, so I think I can now safely remove it.
2009-08-29 17:07:37 +01:00
Chris Wilson
93cfa7376f [win32] Use the system scaled_font_done
Pointless as both functions are empty, but lets be pedantically correct
nevertheless.
2009-08-29 17:07:37 +01:00
Chris Wilson
8654a4b35c [win32] Initialize clip_region
Eek, I attempted to destroy an uninitialised region on the first use
of a clip.
2009-08-29 17:07:37 +01:00
Chris Wilson
9b33a2e1c7 [win32] Compiler warnings
Innocuous warnings about the use of mismatching explicit casts (I'm really
not convinced by the merits of this particular compiler warning, but it
does cleanse the code slightly.)
2009-08-29 17:07:37 +01:00
Chris Wilson
d1740d8782 [pattern] Ensure that no repeated pattern is clipped
Previously the pattern_acquire_surface routine only had to worry about
handling extend modes NONE or REPEAT and so the test for ! REPEAT
sufficed when what was actually intended was a test for NONE.
2009-08-29 17:07:37 +01:00
Chris Wilson
87175334a5 [gl] Use spans for trapezois.
Always use spans, even for unaligned boxes. In the future (given a new
interface) we may want to emit the common unaligned box code more
efficient than a per-scanline computation -- but for now simply avoid the
requirements to write a temporary CPU buffer.
2009-08-29 17:07:36 +01:00
Chris Wilson
e65dfacab5 [gl] Simplify acquire_dest_image()
Remove redundant code: the intersection of surface extents and the copy to
a temporary buffer.
2009-08-29 17:07:36 +01:00
Chris Wilson
5a13396373 [gl] Use common ARRAY_LENGTH macro
Forgo the local ARRAY_SIZE macro where the common one will suffice.
2009-08-29 17:07:36 +01:00
Chris Wilson
efdb53425e [qt] Discard impossible status return from path construction
As we never return an error status during the path construction, we can
use the return value for the QPainterPath instead, greatly simplifying the
callers.
2009-08-29 17:07:36 +01:00
Chris Wilson
f2cde41cab [cairoint.h] Add missing cairo_private to debug prototypes. 2009-08-29 17:07:35 +01:00
Chris Wilson
b6d96bba8a [win32] Trust the clipping code to trim roi to our surface
The higher level code ensures that the region of interest is trimmed to
our declared surface extents, so performing the intersection again is
redundant. Furthermore with the change in the clipping code, the
fallback region is no longer clipped, especially as the clip that is
currently set upon the DC is likely to be stale and incorrect for the
fallback.

Hopefully this resolves the assertion failure reported by Damian Frank,
http://lists.cairographics.org/archives/cairo/2009-August/018015.html

CC:  Damian Frank <damian.frank@gmail.com>
2009-08-29 17:07:35 +01:00
Vladimir Vukicevic
d7faec024a Add skia backend
Originally written by Vladimir Vukicevic to investigate using Skia for
Mozilla, it provides a nice integration with a rather interesting code
base. By hooking Skia underneath Cairo it allows us to directly compare
code paths... which is interesting.

[updated by Chris Wilson]
2009-08-29 17:07:35 +01:00
Chris Wilson
5fdf5b311e [fallback] Reduce paint + clipmask to fill
Under simple, yet common, conditions using a bounded operator and painting
with a single complex clip we can reduce the strength of that operation to
a fill. In effect this removes the need for a temporary mask for some
backends (GL, drm, xlib).
2009-08-29 17:07:34 +01:00
Chris Wilson
425b0e35e2 Add xml surface
A very simple surface that produces a hierarchical DAG in a simple XML
format. It is intended to be used whilst debugging, for example with the
automatic regression finding tools of cairo-sphinx, and with test suites
that just want to verify that their code made a particular Cairo call.
2009-08-29 17:07:34 +01:00
Chris Wilson
c980affce0 [script] Apply device offset when replaying meta surface
As we set the size of the surface to fit the ink extents of the meta
surface, we also need to ensure that the origin  of the script lies at the
origin of the ink extents.
2009-08-29 17:07:33 +01:00