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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>