So that the composite-rectangles remains consistent with the reduced
clip in case the individual compositors try to optimise their rendering
strategies based on the reduced clip and the overall extents.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we will be reducing the clip intersection to a single clip box check
during construction, it helps if we use the tight clip box.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This problem was introduced in commit "xlib: Implement SHM fallbacks and fast
upload paths". Before, cairo_surface_mark_dirty() directly called
cairo_surface_mark_dirty_rectangle() with special "magical arguments" and thus
didn't need any checks on the surface status.
Fixes: api-special-cases
Signed-off-by: Uli Schlachter <psychon@znc.in>
This code tried to optimize the clip away by intersecting the boxes with the
clip polygon. However, it also did so when the server didn't support traps.
Fixes: clip-stroke-unbounded clip-fill-nz-unbounded clip-fill-eo-unbounded
clip-fill clip-fill-rule a1-clip-fill-rule clip-group-shapes-circles
clip-intersect clip-nesting clip-operator clip-push-group clip-polygons
clip-shape clip-text clip-twice inverted-clip mask random-clip
rotate-clip-image-surface-paint trap-clip unantialiased-shapes
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit adds lots of asserts. These asserts verify for each extension
request that we send that the server really supports this.
Sadly, this causes 28 assertion failures in the test suite with xcb-render-0.0.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit removes the hand-written code in cairo-xcb-surface.c and instead
makes use of cairo_compositor_t. Surprisingly, this doesn't break a single test
case. :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
cairo-xcb-surface.c: In function '_drawable_changed':
cairo-xcb-surface.c:1434:39: warning: ignoring return value of '_cairo_surface_begin_modification', declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Uli Schlachter <psychon@znc.in>
The inline functions in cairo-backend-private.h tried to dereference a cairo_t,
which wasn't defined. Fix this by including cairo-private.h.
In cairo-mempool-private.h, size_t is used but stddef.h is not included.
Fixes:
CHECK cairo-backend-private.h
In file included from headers-standalone-tmp.c:1:0:
./cairo-backend-private.h: In function ‘_cairo_backend_to_user’:
./cairo-backend-private.h:179:7: error: dereferencing pointer to incomplete type
./cairo-backend-private.h: In function ‘_cairo_backend_to_user_distance’:
./cairo-backend-private.h:185:7: error: dereferencing pointer to incomplete type
./cairo-backend-private.h: In function ‘_cairo_user_to_backend’:
./cairo-backend-private.h:191:7: error: dereferencing pointer to incomplete type
./cairo-backend-private.h: In function ‘_cairo_user_to_backend_distance’:
./cairo-backend-private.h:197:7: error: dereferencing pointer to incomplete type
CHECK cairo-mempool-private.h
In file included from headers-standalone-tmp.c:1:0:
./cairo-mempool-private.h:61:5: error: unknown type name ‘size_t’
./cairo-mempool-private.h:62:5: error: unknown type name ‘size_t’
./cairo-mempool-private.h:68:8: error: unknown type name ‘size_t’
./cairo-mempool-private.h:73:44: error: unknown type name ‘size_t’
Signed-off-by: Uli Schlachter <psychon@znc.in>
Whenever we discard the fallback surface, we need to destroy the
associated damage tracking, so move this into the common discard
routine.
This should fix the issue when trying to flush the fallback before
the user modifies any foreign Drawables. The current code issued the
flush and then explicitly discard the fallback, but unless it was idle
at the time of the flush the associated damage would not have also been
destroyed. Asserts followed.
References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Use the higher level layer to be sure we detach any snapshots and other
cached data that is invalidated along with the change of Drawable.
Pointed out by the eternally wise Uli Schlachter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
_cairo_surface_begin_modification() performs an internal flush, for
which the xlib backend skips flushing the fallback surface as it will
continue to use it for the subsequent operation. In the case where we
are flushing prior to updating the Drawable, we need to perform an
external flush which will trigger the posting of the damage from the
fallback surface.
Reported-by: Weng Xuetian <wengxt@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the user changes the size of the underlying drawable, we much make
sure that we discard the current ShmPixmap in order to create a new
fallback pixmap of the correct size next time.
Reported-by: Weng Xuetian <wengxt@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In commit 0bfd2acd35
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Aug 13 01:34:12 2012 +0100
xlib: Implement SHM fallbacks and fast upload paths
I made the mistake of inverting the logic for
cairo_xlib_surface_set_drawable() causing it then to never update.
Thanks to Uli Schlachter for spotting my error.
References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Reported-by: Weng Xuetian <wengxt@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to flush any fallback to a foreign drawable upon finish.
However, we must be careful not to attach the snapshot in that case or
else we end up with an expected reference. This is similar to the
treatment of xlib/shm in commit f864e2d70.
Reported-by: Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes regression from commit 83bfd85a13
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Apr 23 19:45:26 2010 +0100
Implement cairo_backend_t
As there exists no public API to perform the operation we needed, and we
failed to create one, the constructed path failed to correctly remove
the device offset.
Fixes copy-path under device translation.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54732
Reported-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In this case we want to prevent the short-circuiting of the flush of the
ShmPixmap that is ordinarily performed during finish().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the surface->backend will be NULL in such an error surface, and we
may be legitimately doing boundary checks to reject the error surface.
The alternative would be to set an explicit error surface backend.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54664
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When transforming the incoming paths, the goal is to transform them from
user space onto the target coordinate system. Currently for relative
paths we used user_to_device_distance as we presumed that there was no
backend scale factor. However, Alex Larsson noticed that these then
broke when playing around with such a device transform...
Reported-by: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Needs a bit of extra work to create the extension event, but this leaves
the application with only a single spurious event to filter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We frequently compare neighbouring edges for their colinearity (in case
we can skip over them in the active list) so we can record the last
comparison and reuse the result next time.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Albeit it too large for gcc to automatically inline, it is only used
from within a single function. Hopefully gcc can optimise better with
the hint.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For the traps it is simpler if we report the status at the end, and
no-op the accumulation of the trap after hitting the error condition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the spline is wholly outside the clip region, accounting for the
stroke width and additional rendering, then we can simplify that spline
with a straight line.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the pen is reduced to a single point, it is effectively invisible
when rasterised, so skip the stroke composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Flushing the shm operation is a fairly rare event, as it is typically
only involved with mixed rendering on a similar image, and should be
triggering its own events. Therefore we should be able to reduce our
event emission to the critical points in order to limit the amount of
extra overhead we generate.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
GLX and EGL devices are thread-aware currently. This
is safe, but on certain GPUs can be very expensive. In
this patch, we expose a new API which turns off the
safety feature in cases where performance is a priority.
Cairo only needs to support one version of the shader language API,
thanks to the dispatch table. This seems unlikely to change any time
soon. This makes the addition of new features, such as a uniform
location cache, simpler.
As the XCheckWindowEvent() has the unwanted side-effect of flushing the
output queue when there is no event available (libX11 seems to be
entirely anti-performant), we need to roll our own that only checks the
already available event queue.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Adding lots of requests without popping the replies causes xcb to
continually sort large lists of unprocessed data. Use an event instead
and regularly dequeue them.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>