Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
File data used by a shading pattern must reusable since the pattern
may read the file multiple times. As currentfile is not reusable, use
the /ReusableStreamDecode to make it reusable.
Now that _emit_smask() can generate A1 masks, the _emit_imagemask()
code can be removed and emit_smask() used instead. An additional
benefit is stencil masks can be generated from ARGB32 and A8 images as
well as A1 providing that the analysis of the transparency shows that
the image is opaque or has bilevel alpha.
There are some inkscape bugs reporting very slow rendering of inkscape
generated PDFs (inkscape uses cairo for PDF output). These bugs are
caused by cairo specifying a page sized bounding box in XObjects and
Patterns. PDF renderers usually use the BBox as the image size when
compositing. As PDFs generated from SVG tends to use a lot of XObjects
and Patterns this can lead to very long rendering times.
These three patches tighten up all the BBoxes in PDF output.
"static cairo_private" means nothing and suncc complains loudly about
it. The visibility of _cairo_double_to_uint64() and
_cairo_uint64_to_double() should just be "static".
Returning a void value is an error on suncc and causes a warning on msvc:
cairo-surface-observer.c(1273) : warning C4098:
'_cairo_surface_observer_release_source_image' : 'void' function
returning a value
Before using some piece of SHM again, we must be sure that the X11 server is no
longer working with it. For this, we send a GetInputFocus when we are done with
the SHM locally and will only use the memory again when the reply comes in.
However, if we are allocating the memory for SHM GetImage, then we can re-use
memory earlier, because the server processes requests in order. So it will only
start writing to the memory after it is done with earlier requests for this
memory. So instead of using GetInputFocus for synchronisation, the SHM GetImage
request will automatically do this for us.
Thanks to Chris Wilson for this idea.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This code was casting a pixman_box32_t* to cairo_box_t*. However, a box uses
fixed point numbers while the pixman box uses integers which means the result
was off by factor 256.
The fix is to replace the use of _cairo_boxes_limit() with
_cairo_boxes_init_with_clip(). However, this means this function no needs to be
passed a clip instead of a clip region which causes some minor changes to
_composite_boxes().
This improves the result for tighten-bounds again. Out of the tested
combinations, 10 are fixed by this. This bug was hit by code similar to this
(Repeating here since that test has so many different cases):
cairo_set_operator (cr, CAIRO_OPERATOR_IN);
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
cairo_rectangle (cr, SIZE / 4, SIZE / 4, SIZE / 2, SIZE / 2);
cairo_clip_preserve (cr);
cairo_fill (cr);
Signed-off-by: Uli Schlachter <psychon@znc.in>
This only wraps the whole code block in an if which checks if the bounded
extents are empty. No other changes are done in here.
This fixes the failed assertion from the tighten-bounds test.
Signed-off-by: Uli Schlachter <psychon@znc.in>
round() is not available on win32 and causes the linking to fail with:
cairo-surface-observer.obj : error LNK2019: unresolved external symbol
round referenced in function percent
cairo_surface_map_to_image() and cairo_surface_unmap_image() are
called by cairo-surface-observer but they are not slim_hidden:
Checking .libs/libcairo.so for local PLT entries
00000000002e27a8 0000019d00000007 R_X86_64_JUMP_SLOT
000000000005df30 cairo_surface_unmap_image + 0
00000000002e2b90 0000026100000007 R_X86_64_JUMP_SLOT
000000000005f5c0 cairo_surface_map_to_image + 0
make check fails because cairo-script-private.h cannot be compiled
standalone:
./cairo-script-private.h:45:1: error: unknown type name ‘cairo_private’
...
./cairo-script-private.h:48:40: error: unknown type name ‘cairo_output_stream_t’
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)
...
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'
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
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>
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>
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>
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>
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>
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>
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>
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>