Commit graph

9711 commits

Author SHA1 Message Date
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
Chris Wilson
2c885a2753 script: Missed break for creating unbounded recording surfaces.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
0c6b892ce3 script: take advantage of the polymorphism of the interpreter
If a function expects a surface but receives a context, it automatically
queries the context's target. We can take advantage of this to short-cut
a few operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
9dc9f24884 script: leave the tail of the RGB24 data unmolested
We clear past the end of the row so that we don't trigger valgrind
warning leaving harmless uninitialised bits inside the input image.
However, for RGB24 the input rowlen is 3*width, whereas we write 4*width
of data, so we need to take account of that and ensure we clear beyond
the end of the written data, not the read data.

Fixes reading of RGB24 input.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
23b1a82e88 pdf: If the recording surface is unbounded, limit the pattern to the ink extents
It is better than crashing!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
3db39deee2 wrapper: Use the backend->snapshot function
Create the snapshot now, rather than a new lazy snapshot surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
320f40ef89 paginated: Use the backend->snapshot
The high-level function creates a new lazy snapshot which is not what we
what - we want a snapshot now!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
47874aacea snapshot: Assert that we do not generate a snapshot clone
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
161836ab49 ps: unwrap recording surface snapshots
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
b8f09f08c4 analysis: prevent recursion whilst analysing recording patterns
Thanks to subsurface recursion. There's a pattern here, but no clean
solution has yet presented itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
8f99e926c8 paginated: unwrap subsurfaces during context creation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
6b3d53646e image: peek through a snapshot to the recording surface behind
Fixes record-* after the recent overhaul.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
8a90b22897 subsurface+recording: handle recursion
Ouch, a nasty bug surfaces after rearranging code to fix the others.
Another self-copy loop this time through a subsurface of a recording
surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
7971c678f1 subsurface: call the high-level cairo_surface_flush
And not the backend directly as this bypasses the extra steps taken in
the higher level to do common actions such as detach snapshots.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
bca9400aec recording: break self-copy loop
This is the root cause of the issue why we never succeeded in
implementing deferred snapshot correctly; that is we decoupled the
source from the target in the upper layers before we make the coupling
inside the lowest level of recording surface. By deferring the copy, we
never saw the detach-snapshot in time.

Fortunately this was only an issue for backends that implemented strong
immutable source semantics! The oversight implies that we need to push
down a similar flush mechanism into all backends.

Fixes self-copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:57 +01:00
Chris Wilson
9f6428c517 recording: remove the duplicate 'content' field
Just use the member in the base class.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:56 +01:00
Chris Wilson
4a990925e9 script: Support unbounded native recording surfaces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:56 +01:00
Chris Wilson
99fa5ff6c2 snapshot: Defer acquisition
Fixes 'xlib-expose-event' but triggers an infinite loop in self-copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 12:37:56 +01:00
Adrian Johnson
79aa04fd50 ps: use deflate compression for ps level 3 2011-08-14 19:19:34 +09:30
Chris Wilson
0f4cc1f118 script: Emit sequences of boxes to as 'rectangle' for clarity
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 20:54:24 +01:00
Chris Wilson
6b7539d96b test/xlib-expose-event: Be kinder to recording surfaces
And only create the source image once.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 20:54:24 +01:00
Chris Wilson
bc34c1c4ef Add missing 'cairo-image-surface-private.h'
It was supposed to be the centre point of e849e7c92, but I had a little
battle with git and lost...

Reported-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 20:54:24 +01:00
Chris Wilson
ba406866be stroke: Rely on the tessellator to remove self-intersections
As handling joins/caps between line segments shorter than
half_line_width is tricky.

Rather than also fixing the bug in traps, remove that code. The plan is
to avoiding hitting the traps code, short-circuiting several steps along
the fast rectangular paths.

Fixes line-width-overlap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 16:41:28 +01:00
Chris Wilson
54c8e8ccfc test: Add a couple of variants to line-width-overlap
The bug may be in only the fast-path, but future bugs may lie elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 16:21:08 +01:00
Chris Wilson
829eabfc95 test/line-width: Refactor and tidy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 16:21:08 +01:00
Chris Wilson
279f6ceb59 Only reduce the clip if it is not in active use for the operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 13:15:36 +01:00
Chris Wilson
d391f0908c pdf: composite-rectangles now require freeing after use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 12:33:16 +01:00
Chris Wilson
afe84fa77f pdf: Compute fill-stroke extents first before trying to use it to set the clip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 12:09:08 +01:00
Chris Wilson
487c5e4d3a recording: replay_all is meant to mean REPLAY && ALL!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 11:54:19 +01:00
Chris Wilson
73b87334a4 surface: Don't modify operator
Specifically don't transform SOURCE into a CLEAR as the paginated
backends may not be able to handle the new operator.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 11:50:27 +01:00