Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Mirrors cairo_xlib_surface_set_drawable, allowing the drawable
targeted by a surface to be changed on the fly.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Any function documented with gtk-doc must not have _ in any parameter
names, or at least that's what I've found. This patch simply renames
parameters as needed to make things work.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
Avoid the assertion failure of creating an error surface for an internal
status by handling the expected UNSUPPORTED condition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The source and target x/y coordinates were swapped. No idea why this only now
caused a test suite failure, perhaps something recently started using SHM?
Fixes: map-bit-to-image, map-to-image-fill
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
cairo-xcb-surface.c:790:2: warning: return from incompatible pointer type
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This fixes the following assert for pretty much every single xcb-fallback test:
cairo-xcb-surface.c:320: _get_image: Assertion `surface->fallback == ((void *)0)' failed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
And only upload the parts of the image that are modified during the
fallback. I have to keep reminding myself that the goal is always to
reduce the amount of fallbacks required...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
surface->use_pixmap always had the value 0. This code is taken from cairo-xlib.
However, in cairo-xlib use_pixmap is set to 20 if XGetImage() fails.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
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. :)
|
|
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>
|
|
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Clang static analysis triggers some reports in non-buggy code.
Silence them trying to follow better coding practices.
|
|
Fixes (for xcb-fallback): map-all-to-image map-bit-to-image map-to-image-fill
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This turns the test suite-failures for map-all-to-image map-bit-to-image
map-to-image-fill with xcb-fallback into failed assertions.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Fixes: map-all-to-image map-bit-to-image map-to-image-fill
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The previous commit fixed a bug in cairo-xlib found by a similar assert, so this
seems to be a good idea to have.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
For an unbounded surface we cannot assume (0, 0, surface_width,
surface_height) as that is wrong and causes the operation to appear
clipped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
A common requirement is the fast upload of pixel data. In order to
allocate the most appropriate image buffer, we need knowledge of the
destination. The most obvious example is that we could use a
shared-memory region for the image to avoid the transfer cost of
uploading the pixels to the X server. Similarly, gl, win32, quartz...
The other side of the equation is that for manual modification of a
remote surface, it would be more efficient if we can create a similar
image to reduce the transfer costs. This strategy is already followed
for the destination fallbacks and this merely exposes the same
capability for the application fallbacks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Fixes: arc-infinite-loop clip-all clip-empty-group clip-fill-no-op
pattern-getters
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Every xcb surface had its own copy of the flags from the time that it was
created. This means that, if you want to make use of
cairo_xcb_device_debug_cap_xrender_version() and
cairo_xcb_device_debug_cap_xshm_version(), you first had to create a dummy xcb
surface, use that to get access to the cairo_device_t so that you can use these
functions and only then create your real surface, because the change only
affected new surfaces.
This commit changes everything to use the connection's flag and removes the
per-surface flags. This avoids the dummy surfaces completely.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
A demonstration of step 2, improves performance for selected benchmarks
on selected GPUs by up to 30%.
firefox-fishbowl on snb {i5-2520m): 42s -> 29s.
firefox-talos-gfx on snb: 7.6 -> 5.2s.
firefox-fishbowl on pnv (n450): 380 -> 360s.
Whist this looks like it is getting close to as good as we can achieve,
we are constrained by both our API and Xrender and fishbowl is about 50%
slower than peak performance (on snb).
And it fixes the older performance regression in firefox-planet-gnome.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Allow a backend to completely reimplement the Cairo API as it wants. The
goal is to pass operations to the native backends such as Quartz,
Direct2D, Qt, Skia, OpenVG with no overhead. And to permit complete
logging contexts, and whatever else the imagination holds. Perhaps to
experiment with double-paths?
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The experiment was at best a pyrrhic victory. Whilst it did show that
you could successfully subvert cairo_xcb_surface_t and provide the
rendering locally faster (than the xlib driver at that time), any
performance benefits were lost in the synchronisation overheads and
server-side buffer allocation.
Once cairo-gl is mature, we need to look at how we can overcome these to
improve client-side rendering
In the meantime, cairo-xcb is no longer my playground for
experimentation and is shaping up to become a stable backend...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
render.h gives us nice descriptive names for the precise/imprecise poly modes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
In 63bdae27a83, new fields were added to cairo_xcb_connection_t and
cairo_xcb_surface_t. The same change was done in the xlib backend.
However, in the xlib backend these new fields were properly initialized. This
was forgotten in the xcb backend.
Hopefully-Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38482
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This adds checks for negative sizes in cairo_surface_create_similar() and for
non-positive sizes in all public surface-creation functions in the xcb and xlib
backends.
X11 doesn't allow 0 as width/height, so if anyone claims to have a drawable of
that size, he can't be right. However, cairo allows such sizes which is why
create_similar doesn't reject 0.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
We can't use an X11 surface in create_similar if the specified coordinates are
too small/large. However, we can still use SHM-backed memory for the image
surface which will be used instead.
Thanks to Chris Wilson for the hint.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This reverts commit f6e6891b59656c944a7e758a53e07ed5f29f5c39.
Returning NULL in these cases is actually the right thing to do, because the
caller expects and handles this case.
cairo_surface_create_similar() won't return NULL due to this, because
_cairo_surface_create_similar_solid() will fall back to an image surface.
I think I missed that part when I wrote the bad commit.
This was found via the test suite's "zero-mask" test.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31368
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
If we can't use SHM, we still have PutImage. So instead of returning the error
to the caller, it makes sense to retry with a normal image surface.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
These docs are based upon cairo-xlib and the existing documentations for
cairo_xcb_surface_create_with_xrender_format.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This makes the xcb backend use the auto-generated xcb API instead of
hand-writing each request. This should also improve parallelism with non-cairo
threads that use the same xcb connection.
Big thanks to Andrea Canciani for taking a look at this and finding lots of good
improvements (especially finding xcb_send_request was great).
cairo-perf-trace and cairo-perf-diff-files between master
(6732dbf2992891be4b1f08b14a5c449fd08b637c) and this change:
$ ./cairo-perf-diff-files ../master_perf ../xcb_no_socket_perf
old: master_perf
new: xcb_no_socket_perf
Speedups
========
xcb-rgba evolution-0 23558.86 (23558.86 0.00%) -> 19338.78 (19338.78 0.00%): 1.22x speedup
▎
xcb-rgba poppler-bug-12266-0 98.43 (98.43 0.00%) -> 82.36 (82.36 0.00%): 1.20x speedup
▎
xcb-rgba gnome-terminal-vim-0 5518.08 (5518.08 0.00%) -> 4905.92 (4905.92 0.00%): 1.12x speedup
▏
xcb-rgba gnome-terminal-20090601-0 45648.46 (45648.46 0.00%) -> 41231.25 (41231.25 0.00%): 1.11x speedup
▏
xcb-rgba evolution-20090607-0 71643.69 (71643.69 0.00%) -> 66314.95 (66314.95 0.00%): 1.08x speedup
▏
xcb-rgba poppler-0 3501.69 (3501.69 0.00%) -> 3322.26 (3322.26 0.00%): 1.05x speedup
Slowdowns
=========
xcb-rgba gnome-system-monitor-0 7500.01 (7500.01 0.00%) -> 7923.70 (7923.70 0.00%): 1.06x slowdown
xcb-rgba swfdec-youtube-full-0 26409.89 (26409.89 0.00%) -> 28430.76 (28430.76 0.00%): 1.08x slowdown
▏
xcb-rgba gnome-system-monitor-20090821-0 34801.61 (34801.61 0.00%) -> 37891.14 (37891.14 0.00%): 1.09x slowdown
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
We still don't track various error conditions...
|
|
This fixes "text-rotate" in the test suite for the image backend and
"overlapping-glyphs" for the xcb backend.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
We want surface->depth to end up as "32", so we have to invent an alpha mask.
This mask is not used anyway (only its popcount), but still this should get a
less ugly fix.
This was found because "assert (reply->depth == surface->depth);" in
_get_image() failed.
Original-patch-by: Ross Alexander <Ross.Alexander@EU.NEC.COM>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Sun Studio Compiler complains:
"cairo-xcb-surface.c", line 585: void function cannot return value
even if the returned value is void.
Some minor code restructuring removes the issue.
|
|
I did this manually so I could review the docs at the same time.
If anyone finds typos or other mistakes I did, please complain to me (or
better: fix them).
|