summaryrefslogtreecommitdiff
path: root/src/cairo-xcb-surface.c
AgeCommit message (Collapse)AuthorFilesLines
2011-12-05xcb: Fixup some internal state in set_{drawable,size}Uli Schlachter1-3/+25
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-02xcb: Silence a compiler warning for mixing status and internal status enumsChris Wilson1-1/+1
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02Add cairo_xcb_surface_set_drawableKeith Packard1-0/+68
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>
2011-12-02cairo-xcb: gtk-doc doesn't like _ in parameter namesKeith Packard1-24/+24
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>
2011-11-18xcb: Fix typoAndrea Canciani1-1/+1
2011-11-18xcb: Handle SHM exhaustion gracefullyChris Wilson1-4/+6
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>
2011-09-22xcb: Fix device offsets with unmap_image()Uli Schlachter1-2/+2
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>
2011-09-22xcb: Fix a "incompatible pointer" compiler warningUli Schlachter1-1/+1
cairo-xcb-surface.c:790:2: warning: return from incompatible pointer type Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22xcb: Don't try to fallback more than onceUli Schlachter1-4/+8
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>
2011-09-19xcb: track fallback damageChris Wilson1-69/+245
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>
2011-09-14xcb: Remove some dead codeUli Schlachter1-13/+11
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>
2011-09-12Introduce a new compositor architectureChris Wilson1-22/+11
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. :)
2011-09-02xcb: Steal from the pending list for GetImageUli Schlachter1-0/+3
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>
2011-08-18xcb: Handle SHM exhaustion via falling backUli Schlachter1-2/+7
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>
2011-08-18xcb: Merge two functions for creating shm imagesUli Schlachter1-41/+5
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>
2011-08-18xcb: Fallback to image if allocating SHM failsUli Schlachter1-1/+1
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>
2011-08-13image: move surface definition to new header for subclassingChris Wilson1-50/+48
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-29Silence Clang static analyzer reportsAndrea Canciani1-1/+1
Clang static analysis triggers some reports in non-buggy code. Silence them trying to follow better coding practices.
2011-07-29xcb: Handle fallback in map_to_imageUli Schlachter1-0/+7
Fixes (for xcb-fallback): map-all-to-image map-bit-to-image map-to-image-fill Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-29xcb: _get_image only works without fallbackUli Schlachter1-0/+1
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>
2011-07-29xcb: Handle deferred clear in map_to_imageUli Schlachter1-1/+25
Fixes: map-all-to-image map-bit-to-image map-to-image-fill Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-27xcb: Check that the extents are inside our surfaceUli Schlachter1-0/+5
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>
2011-07-26composite: Pass unbounded extents to initialisationChris Wilson1-1/+1
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>
2011-07-26API: map-to-image and create-similar-imageChris Wilson1-221/+201
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>
2011-07-21xcb: Unset the deferred_clear flag on fallbackUli Schlachter1-0/+3
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-21xcb: Handle deferred_clear in _get_imageUli Schlachter1-0/+11
Fixes: arc-infinite-loop clip-all clip-empty-group clip-fill-no-op pattern-getters Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-21XCB: Store the flags per-connection onlyUli Schlachter1-6/+4
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>
2011-07-20xcb: squash initial ChangePicture request for precisionChris Wilson1-1/+4
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-20xcb: Take advantage of clip-boxesChris Wilson1-0/+1
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>
2011-07-19clip: Rudimentary support for clip-polygon extractionChris Wilson1-14/+14
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>
2011-07-18cairo-xcb: Drop some unused definitions/fileUli Schlachter1-2/+0
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-15xcb: Remove more bits of drm integrationChris Wilson1-63/+2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-15Implement cairo_backend_tChris Wilson1-0/+3
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>
2011-07-14Excise xcb-drmChris Wilson1-104/+0
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>
2011-06-24xcb: Use defines instead of magic numbersUli Schlachter1-1/+1
render.h gives us nice descriptive names for the precise/imprecise poly modes. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24xcb: Initialize the new precision fieldsUli Schlachter1-0/+1
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>
2011-06-24xcb,xlib,surface: Check for too small sizesUli Schlachter1-1/+7
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>
2011-06-12xcb: Fallback to image surface for create similarUli Schlachter1-5/+5
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>
2011-06-11Revert "xcb: Never return NULL from create_similar"Uli Schlachter1-2/+2
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>
2011-03-16xcb: Compile fix when using xcb-drmChris Wilson1-1/+1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31368 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-15xcb: Never return NULL from create_similarUli Schlachter1-2/+2
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-31xcb: Use a normal image surface if SHM failsUli Schlachter1-2/+1
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>
2011-01-26xcb: Document all public functionsUli Schlachter1-1/+69
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>
2011-01-02Remove an unused field from cairo_xcb_shm_info_tUli Schlachter1-11/+10
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-25XCB: Stop taking the xcb socketUli Schlachter1-24/+6
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>
2010-11-08xcb: Add more _cairo_error() callsBenjamin Otte1-7/+7
We still don't track various error conditions...
2010-10-21raster backends: Set round_glpyh_positions to ONUli Schlachter1-0/+1
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>
2010-10-13xcb: Correctly handle ARGB visualsUli Schlachter1-0/+3
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>
2010-10-05xcb: Do not return value in void functionAndrea Canciani1-6/+4
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.
2010-07-08doc: Move tmpl/ docs to inline docsBenjamin Otte1-0/+13
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).