Commit graph

7513 commits

Author SHA1 Message Date
Chris Wilson
3e7e0eacef Update reference images
Refresh the test reference images to match the current output where
acceptable.
2009-08-29 17:07:41 +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
52e5ce3a36 [test] Add clip-stroke
Soeren was the first to report a clipping regression in the xlib backend
with strokes, and provided a test case to exercise the bug. This is an
extension of his test to provide coverage of different clipping and
stroking methods.
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
92f6f275fc [test] Implicit close
This is a simple test that broke with the determination of rectilinearity
during path construction. I forgot the implicit close on fill and so the
ignored the final diagonal edge and failed to draw the triangle.
2009-08-29 17:07:38 +01:00
Chris Wilson
8078cd194e [boilerplate] Runtime library check
For the purposes of benchmarking it is useful to run cairo-perf against a
different library from the one it was compiled against. In order to do so,
we need to check that the runtime library contains the required entry
points for our targets - which we can check by using dlsym.
2009-08-29 17:07:38 +01:00
Chris Wilson
7447915381 [script] Conditionalise the build
Allow the interpreter to be disabled if we can not satisfy its dependencies.
2009-08-29 17:07:37 +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
958f7ab123 [script] Support running on cairo-1.8
Pre 1.9 the application had to pass a resolved font to cairo -- so do so
in the interpreter if the cairo version is less than 1.9
2009-08-29 17:07:36 +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
af6df4af51 [configure] Choose a better name for the 'temporary' egl iterator
The problem is that it remains referenced by egl_NONPKGCONFIG_LIBS and so
must not be subsequently overwritten, so give it an egl_ prefix.
2009-08-29 17:07:35 +01:00
Chris Wilson
83c2f44dd9 [test] Update REFERENCE_IMAGES 2009-08-29 17:07:35 +01:00
Chris Wilson
f99e184144 [build] Remove -Wcast-align
Use -Wcast-align simply generates too much noise due to false-positive
reports when casting pixels to uint32_t.
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
6e0b3be903 Add cairo-sphinx utility for regression analysis
sphinx is an alternate version of the current cairo-test-trace. It's
purpose is to replay a live application (which may just be a replay of a
trace) against a backend and its reference. The improvement over the
original cairo-test-trace is that the reference backend may be from an
older version of cairo.
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
Chris Wilson
eb33f842dc [meta] Missing status check
We need to check the status on the created image before use.
2009-08-29 17:07:33 +01:00
Chris Wilson
ce6a2cc5d2 [wrapper] Always copy clip
We always need to make a local copy of the clip as the backends are free
to modify it as they process the operation.
2009-08-29 17:07:33 +01:00
Chris Wilson
6ff711b630 [matrix] Improve bbox finding for translation matrix
If the matrix is a pure translation matrix than we can skip determination
of the extents and just translate the input bbox.
2009-08-29 17:07:02 +01:00
Chris Wilson
cd7b27ff5c Add 'flight-data-recorder' utility.
This is a simple variation on cairo-trace that wraps records the last 16
contexts by wrapping the target surface inside a tee surface, along with a
meta/recording surface. Then on receipt of a SIGUSR1, those last 16
contexts are played via a script-surface into /tmp/fdr.trace.

Mostly proof-of-concept, it seems to be causing a number of rendering
glitches whilst testing with firefox -- otherwise, it seems to works.
2009-08-29 08:08:39 +01:00
Chris Wilson
658cdc7c9a Introduce cairo_tee_surface_t
Add a new surface type that multiplies it input onto several output
surfaces. The only limitation is that it requires a master surface that is
used whenever we need to query surface options, such as font options and
extents.
2009-08-29 08:08:39 +01:00
Chris Wilson
4ae7186719 [script] Correct emission of get_target() for a popped context
If the context is no longer on the operand stack, then we need to recall
the surface via a definition.
2009-08-29 08:08:39 +01:00
Chris Wilson
8d1bf830c0 Fix errors found by clang
Shadowed variables, unused writes and some dead code.
2009-08-29 08:08:39 +01:00
Chris Wilson
d8dbce021a [script] recursive active (type3 glyphs)
The assumption that an active surface could not recurse into another
operation was invalid - due to the complexity of handling type3 glyphs.
2009-08-29 08:08:38 +01:00
Chris Wilson
eba6b5126a [build] Add options for warning about bad casts
-Wbad-function-cast in particular. Triggers quite a few warnings where we
have explicitly cast to an integer.
2009-08-29 08:08:38 +01:00
Chris Wilson
33ef32af4e [clip] Use the rectangular tessellator to extract boxes 2009-08-29 08:08:38 +01:00
Chris Wilson
ab035ab2c7 [tessellate] Rectangular special case
Add an even simpler sweep-line tessellator for rectangular trapezoids (as
produced by the rectilinear stoker and box filler).

This is so simple it even outperforms pixman's region validation code for the
purposes of path-to-region conversion.
2009-08-29 08:08:38 +01:00
Chris Wilson
d7b0c3b784 [script] Track scaled-font
Instead of emitting the (font-face, matrix and options) elements when
setting up the desired font on the matrix, simply restore the scaled-font.
2009-08-29 08:08:38 +01:00
Chris Wilson
7306305cc8 [script] Emit surface content
Include the desired content with the creation info.
2009-08-29 08:08:37 +01:00
Chris Wilson
052211b072 [script] Garbage collect contexts on context switch
Previously the contexts were permanently associated with the surface and
only destroyed along with the final reference to the surface. This meant
that we kept a large number of unwanted contexts in memory. Most
applications only have a few contexts active at any time, so remove
inactive contexts from the operand stack every time we perform an
operation on a different context.
2009-08-29 08:08:37 +01:00