Commit graph

6152 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Chris Wilson
c715d52af5 snapshot: restore the order of detach vs callback
Mucking around in 99fa5ff6c2, I tweaked the order to mark the
snapshot as detached before calling the callback. xcb relies on the old
ordering so that it can correctly update its fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 12:08:27 +01:00
Chris Wilson
2a694a969c observer: print stroke caps/joins frequencies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 11:27:54 +01:00
Chris Wilson
f3b414abfa observer: print operator frequencies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 11:27:54 +01:00
Chris Wilson
7ad4c8e711 observer: report number of solid patterns first
As these tend to be the quickest, and putting them first keeps the reports
are in an estimated fast->slow order.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 11:27:54 +01:00
Chris Wilson
545f30856a stroke: Convert the outlines into contour and then into a polygon
In step 1 of speeding up stroking, we introduce contours as a means for
tracking the connected edges around the stroke. By keeping track of
these chains, we can analyse the edges as we proceed and eliminate
redundant vertices speeding up rasterisation.

Coincidentally fixes line-width-tolerance (looks like a combination of
using spline tangent vectors and tolerance).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 10:31:47 +01:00
Chris Wilson
bbe704406c stroke: move normal stroker to new file
Step 1 of enhancing the speed of the stroker is to segregate from the
rest of the complex code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 08:39:20 +01:00
Chris Wilson
2e1726a05b recording: Defend against bad user-input
Adjusting the _cairo_surface_is_recording() to check the value
in the backend exposed us to a potential NULL pointer dereference
on validating user-input. So add an explicit status check which
has the added bonus of being more correct!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 00:34:35 +01:00
Chris Wilson
edf2d3e8b2 check: make check-headers happy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 00:26:09 +01:00
Chris Wilson
2220693a40 Introduce cairo_mime_surface_t
The mime surface is a user-callback surface designed for interfacing
cairo with an opaque data source. For instance, in a web browser, the
incoming page may be laid out and rendered to a recording surface before
all the image data has finished being downloaded. In this circumstance
we need to pass a place holder to cairo and to supply the image data
later upon demand.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 00:16:09 +01:00
Chris Wilson
eed1f2efdf xml: Include 'cairo-image-surface-private.h'
Reported-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 21:02:08 +01:00
Chris Wilson
08627ed0f3 tee: compile fix for migration of _cairo_is_recording_surface()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 21:01:42 +01:00
Chris Wilson
62e48b01b4 script: enable by default
I'm willing to make this a supported backend as I find it to be an
invaluable debugging tool...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 21:01:29 +01:00
Chris Wilson
eee66899cd Introduce cairo_surface_observer_t for performance analysis
Another logging passthrough surface that records the style of operations
performed trying to categorise what is slow/fast/important.

In combination with perf/cairo-analyse-trace it is very useful for
understanding what a trace does. The next steps for this tool would be
to identify the slow operations that the trace does. Baby steps.

This should be generally useful in similar situations outside of perf/
and should be extensible to become an online performance probe.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 20:54:53 +01:00
Chris Wilson
f6fc6f1ad0 gstate: Copy clusters for an untransformed unbounded surface
Fixes record-select-font-face

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 15:29:08 +01:00
Chris Wilson
5bc7c059fd script: Hook image caching into the snapshot mechanism
So that we remember to forget the old image when the surface is dirtied.

Fixes filter-bilinear-extents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 15:00:13 +01:00
Chris Wilson
d4a32baed1 surface: Rearrange nothing_to_do? to catch OVER + clear source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 14:49:56 +01:00
Chris Wilson
0053a44f6b record: Offset the clip by the replay transformation as well
Fixes push-group-offset which reduces to a replay of a recording surface
inside a recording surface and forgot to offset the clip imposed by the
extents of the first recording surface into device space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 14:45:00 +01:00
Chris Wilson
eb09a68638 xlib: Move the Display pointer nullify into destroy from finish
Oops, should have checked with more than just the one test before
claiming victory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 13:52:11 +01:00
Chris Wilson
84a3b6e2d0 xlib: Mark surfaces as finished when the Display is finished/destroyed/closed.
Fixes xlib-surface-source with the recording-surface

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 13:47:43 +01:00