"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>
Microsoft C Compiler complains about:
hash-table.c(44) : error C2466: cannot allocate an array of constant
size 0
Adding an unused element makes it happy.
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’
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
...
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>
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>
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>
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>
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>
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>
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>