Commit graph

9759 commits

Author SHA1 Message Date
Andrea Canciani
6d6bfbd641 Introduce the cairo-missing library
The cairo-missing library provides the functions which are needed in
order to correctly compile cairo (or its utilities) and which were not
found during configuration.

Fixes the build on MacOS X Lion, which failed because of collisons
between the cairo internal getline and strndup and those in libc:

cairo-analyse-trace.c:282: error: static declaration of ‘getline’ follows non-static declaration
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
cairo-analyse-trace.c:307: error: static declaration of ‘strndup’ follows non-static declaration
...
2011-09-02 12:27:13 +02:00
Andrea Canciani
0101a54579 time: Add cairo_time_t type
Add the cairo_time_t type (currently based on cairo_uint64_t) and use
it in cairo-observer and in the perf suite.

Fixes the build on MacOS X (for the src/ subdir) and Win32, whch
failed because they don't provide clock_gettime:

cairo-surface-observer.c:629: error: implicit declaration of function 'clock_gettime'
cairo-surface-observer.c:629: warning: nested extern declaration of 'clock_gettime'
cairo-surface-observer.c:629: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
...
2011-09-02 12:27:13 +02:00
Andrea Canciani
e7204a3631 win32: Fix compilation
cairo-image-surface-private.h is needed in order to access
cairo_image_surface_t fields.

Fixes multiple build errors:

error C2037: left of '...' specifies undefined struct/union
'_cairo_image_surface'
2011-09-02 12:00:29 +02:00
Andrea Canciani
0c620080af quartz: Fix compilation
cairo-image-surface-private.h is needed in order to access
cairo_image_surface_t fields.

Fixes multiple build errors: dereferencing pointer to incomplete type
2011-09-02 12:00:29 +02:00
Andrea Canciani
6fd174b423 perf: Silence gcc warning
Silence:

dragon.c: In function 'do_dragon_solid':
dragon.c:167: warning: unused variable 'r'
2011-09-02 12:00:29 +02:00
Uli Schlachter
d66d9cd777 xcb: Fix fallback for *_shm_put_image
This function shouldn't ever be called is xcb-shm is disabled. However, it is
still defined to avoid lots of #ifdefs.

Additionally, this removes the only use of uint64_t from cairo-xcb.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-30 22:19:33 +02:00
Uli Schlachter
5f45f696d0 xcb: Add an assert for the tighten-bounds test
This code casts the result of _cairo_xcb_surface_create_similar() to
cairo_xcb_surface_t*. However, the tighten-bounds test makes this run with
bounded extents of size 0x0 and thus _cairo_xcb_surface_create_similar() falls
back to an image surface. Ugly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-30 22:10:34 +02:00
Uli Schlachter
70118ee119 test: Add tighten-bounds
In the spirit of the new big-{little,empty}-{box,triangle} tests, this test
combines various paths. However, these paths are not only filled but also used
for clipping, resulting in 120 different combinations.

No backend currently succeeds the test. The reference image is a gimp-ination of
the image and test-fallback results and thus certainly wrong. Feel free to fix.

Additionally, this makes the xcb backend die with an ugly failed assert.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-30 22:03:33 +02:00
Chris Wilson
7df7964333 observer: Add missing return codes
Upon detecting the user error, supply an error code!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-30 15:17:41 +01:00
Chris Wilson
70cd3b473d api: Extend cairo_antialias_t to include performace/quality hints
The existing API only described the method to be used for performing
rasterisation and unlike other API provided no opportunity for the user
to give a hint as to how to trade off performance against speed. So in
order to no be overly prescriptive, we extend the NONE/GRAY/SUBPIXEL
methods with FAST/GOOD/BEST hints and leave the backend to decide how
best to achieve those goals.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-30 15:17:38 +01:00
Chris Wilson
6b1daace57 perf: Print a summary of each operation for a trace (using '-s')
In order for this to be effective on small system we also need to
disable the recording of the long traces which exhaust all memory...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-30 13:28:47 +01:00
Chris Wilson
7ae2708fc8 test: Add big-empty-triangle
One last variant to make sure we handle the case of the disappearing
unbounded triangle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-29 15:58:28 +01:00
Chris Wilson
f71cfe84fe test: Add big-empty-box
Another variant on big-little-box, to make sure we trim the extents
before doing the empty unbounded fixup.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-29 15:58:20 +01:00
Chris Wilson
249c89c313 test: Add big-little-triangle
A variant on big-little-triangle to exercise the non-rectangular paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-29 15:58:09 +01:00
Adrian Johnson
2927d13ab2 pdf: use a new clipper object in recording_subsurface 2011-08-29 21:31:09 +09:30
Adrian Johnson
c317e215fb ps/pdf: use a new clipper object when emitting a recording surface 2011-08-29 21:27:23 +09:30
Krzysztof Kosiński
8d91de4926 test: Add test case from bug-40410
Exercises a case where we failed to fill a rectangle...
2011-08-26 23:04:01 +01:00
Chris Wilson
09d8fc926f test: Add clip-mixed-antialias
The wonders one sees when looking at webpages. Who knew people would be
so inventive with clips?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-26 10:41:59 +01:00
Adrian Johnson
bd44455131 font-subsets: fix wrong string length 2011-08-24 20:35:10 +09:30
Behdad Esfahbod
c13249c63a [ft] Minor 2011-08-23 15:51:05 +02:00
Chris Wilson
6cdad1931a observe: Provide the sum of the elapsed time of the individual operations
We can use the elapsed time of the indiividual operations to profile the
synchronous throughput of a trace and eliminate all replay overhead. At
the cost of running the trace synchronously of course.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-23 14:41:10 +01:00
Adrian Johnson
ba1060fbbc cff-subset: fix decoding of real numbers 2011-08-23 00:32:51 +09:30
Adrian Johnson
cdb00dec42 cff-subset: don't easily give up parsing a charstring if we already have the width
The 2 byte operators can be ignored of we don't need or have already found
the width.
2011-08-21 20:12:42 +09:30
Adrian Johnson
23dfd92b29 cff-subset: fallback when parsing the charstrings in bare cff fonts fails
We need to parse all used charstrings in bare CFF fonts to extract the widths.
2011-08-21 18:27:07 +09:30
Chris Wilson
c3e990ea7d observer: correct classification of aligned paths
We were misclassifying rectilinear paths as aligned strokes, which is
bogus until we analyse the offset path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 16:34:38 +01:00
Chris Wilson
bb3d06a5dc test: Add shape-general-concave
A discussion that we've been having is the use of contours in filling,
and for optimizing for convex contours in particular. A devious mind
quickly generates a shape using a convex "contour" whose hull is larger
than its area. This is due to the self-intersection of the "contour"
which if properly excised causes the contour to be classed as concave.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 16:14:13 +01:00
Chris Wilson
2134306eaf test: Extend rotate-image-surface-paint
Apply two common clipping methods just to add a little bit of further
complication.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 14:11:30 +01:00
Chris Wilson
9f6820210d test: Extend record-extend to exercise similar surface sources
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 13:09:41 +01:00
Chris Wilson
f8f25f52ec test: Add record-mesh
Test capture and replay of mesh patterns.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 13:09:41 +01:00
Chris Wilson
4226bfd695 test: Add big-little-box
This exercises the bug

  https://bugzilla.mozilla.org/show_bug.cgi?id=668921

which is caused by a failure to tighten the extents after tessellating
the path and the unbounded fixup is skipped as it is believed the path
covers the whole area.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 13:09:40 +01:00
Chris Wilson
2eeae45cc7 test: Add checkerboard
Simply tests the rendering of the checkerboard commonly used as a
background in the test suite.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 13:09:40 +01:00
Chris Wilson
4d6c62514c observer: bypass surface mid-layer and call into recording surface directly
As we want to record the exact command pass to us, we want to bypass any
further optimisations that the surface mid-layer might perform before
passing the operation to the recording surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 13:02:00 +01:00
Chris Wilson
f49dae8013 observer: copy glyphs around call into backend
As the backend is allowed to modify the glyph array, we need to copy it
for recoding.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 13:01:01 +01:00
Chris Wilson
cb243acee5 recording: optionally disable optimise away clears
The observer wants to get an accurate recording of all operations,
including clears.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 12:48:25 +01:00
Chris Wilson
236cb8aa22 xlib: Fix typo in snapshotting.
We want to only copy up to the maximum height, not width...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 12:01:09 +01:00
Chris Wilson
0efdc8d27e observer: record all operations and their timings
The immediate use of this is to print out the slowest operation of each
type in a replayable manner. A continuing demonstration of how we may
analyse traces...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 11:51:50 +01:00
Chris Wilson
713c8069be perf: Cleanup target after each run
As the trace may leak surfaces over its lifetime, we are forced to
teardown the connection between runs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-19 22:32:31 +01:00
Uli Schlachter
5d92ce3a18 xcb-shm: Fix a logic error while allocating mem
The "continue;" in the old code never worked, because it first checked the loop
condition. Since "FALSE" (hopefully) never evaluates to true, the loop was still
left.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-18 16:34:44 +02:00
Uli Schlachter
73e7391e6e xcb: Handle SHM exhaustion via falling back
When we couldn't get an image from the X11 server via SHM because we ran out
shared memory, we should try again via a normal GetImage request.

Fixes: xcb-huge-image-shm

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-18 16:34:44 +02:00
Uli Schlachter
aeba5acbad test: Add a test that maps a huge surface
This test currently fails in the xcb backend if xcb-shm is enabled.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-18 16:34:44 +02:00
Uli Schlachter
8951c51d9e xcb: Merge two functions for creating shm images
This merges most of _cairo_xcb_surface_create_similar_image() into
_cairo_xcb_shm_image_create().

These two functions where already doing almost the same thing with only some
differences in error handling.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-18 16:34:44 +02:00
Uli Schlachter
0da3d3efd2 xcb: Fallback to image if allocating SHM fails
This turns an !!!ERROR!!! for scale-offset-similar with xcb-fallback into a
failed test and might fix other problems. However, since the problem here partly
is a race, those other problems might only be hit sometimes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-18 16:34:44 +02:00
Chris Wilson
2f020c4ade obsever: include the operation timings
Seeing the relative amounts of time spent in each operation and the
slowest one of each, gives further insight into the peculiarities of a
trace. And hopefully point out areas of improvement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 14:10:20 +01:00
Chris Wilson
4d5502503c observer: put a comma between array items when printing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 12:41:20 +01:00
Chris Wilson
d03b0057b2 observer: further classify general clips
A clip with only a single path or can be reduced to a single polygon are
easier to handle than a clip containing a mixture of paths (typically
ANTIALIAS_NONE vs ANTIALIAS_DEFAULT).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 12:37:57 +01:00
Chris Wilson
76a3d0dc11 observer: only print out the non-zero clip types
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 12:10:20 +01:00
Chris Wilson
a8232ff77c observer: only print out the non-zero path types
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 12:10:20 +01:00
Chris Wilson
e4b4b6bfd9 obverser: only print out the active patterns
I prefer the reduced output as exemplified by the operator message.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 12:10:19 +01:00
Chris Wilson
e8ed203da3 observer: print path antialias modes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 12:10:18 +01:00
Adrian Johnson
75b32d6196 pdf: change end of line in pdf output from \r\n to \n 2011-08-16 22:42:35 +09:30