summaryrefslogtreecommitdiff
path: root/src/cairo-xcb-connection.c
Commit message (Collapse)AuthorAgeFilesLines
* xcb: Remove free XID cacheUli Schlachter2021-05-021-48/+2
| | | | | | | | | | | | | | cairo-xcb kept a cache of free xid to avoid calling xcb_generate_id() later. However, this is unsafe: When libxcb runs out of ids, it asks the X11 server for an empty range of ids to use. The X11 server of course does not know about cairo's cache and could hand out an id that cairo will use again later. This would then result in BadIdChoice errors later. Fix this by simply removing the whole cache. Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/434 Signed-off-by: Uli Schlachter <psychon@znc.in>
* Use _cairo_malloc instead of mallocAdrian Johnson2018-05-071-3/+3
| | | | | | | | | | _cairo_malloc(0) always returns NULL, but has not been used consistently. This patch replaces many calls to malloc() with _cairo_malloc(). Fixes: fdo# 101547 CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* xcb: Query the display's subpixel order via RENDERUli Schlachter2015-01-171-0/+19
| | | | | | | | | | | | | | | | | With commit e691d242, the xcb backend started parsing the resources, just like cairo-xlib does. One behavior from cairo-xlib was missing: If no Xft.rgba property was specified, cairo-xlib defaults to the screen's subpixel order. This commit brings that last bit of functionality to cairo-xcb (but currently disabled due to commit e0c0a673). This commits adds a new array to cairo_xcb_connection_t that contains the subpixel order for each screen. There is also a new member in cairo_xcb_screen_t which contains the subpixel order of that screen and which is initialized from the array when the screen is constructed. With this in place, the resource-parsing code can just pick the subpixel order from the screen if needed. Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Add switches for whether XRender supports GOOD/BEST filteringBill Spitzak2014-10-101-0/+10
| | | | | | | Currently these are always false, but if XRender use a pixman that supports filtering these could be turned on for that version. Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* Split cairo-list into struct+inlinesChris Wilson2012-04-191-1/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* xcb/xlib: Add missing "Since: 1.12"Uli Schlachter2012-03-261-0/+4
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* doc/xcb: document cairo_xcb_device_get_connectionNis Martensen2012-03-101-0/+10
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* doc/xlib/xcb: document get/set_precision APINis Martensen2012-03-101-1/+20
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* xlib-xcb: Fix make checkUli Schlachter2012-03-031-0/+3
| | | | | | | | | | | | cairo_xcb_device_debug_cap_xrender_version is called by xlib-xcb's cairo_xlib_device_debug_cap_xrender_version and thus must be marked slim_hidden. Checking .libs/libcairo.so for local PLT entries 0000000000306ff8 0000024200000007 R_X86_64_JUMP_SLOT 000000000009e720 cairo_xcb_device_debug_cap_xrender_version + 0 FAIL: check-plt.sh Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Silence compiler warnings about ignored return valuesUli Schlachter2011-12-111-2/+8
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: track fallback damageChris Wilson2011-09-191-4/+2
| | | | | | | | 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>
* Introduce a new compositor architectureChris Wilson2011-09-121-1/+1
| | | | | | | | | | | | | | | | | | 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. :)
* hash: Compare hash values before calling keys_equalAndrea Canciani2011-08-011-9/+2
| | | | | | If the hash value is different, the keys cannot be equal. Testing this beforehand can avoid a few function calls and shares this optimization across all cairo-hash uses.
* xcb: Parse $CAIRO_DEBUG just like cairo-xlib doesUli Schlachter2011-07-211-0/+38
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* Xlib,xcb: Make *_debug_[sg]et_precision() more robustUli Schlachter2011-07-211-4/+18
| | | | | | | This adds checks for NULL pointers, devices in an error state and devices which aren't owned by the right backend. Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Make it possible to undo _cairo_xcb_device_debug_cap_*Uli Schlachter2011-07-211-0/+12
| | | | | | | | | | We now remember the original flags before any call to cairo_xcb_device_debug_cap_xshm_version() or cairo_xcb_device_debug_cap_xrender_version() was done and re-set these flags on any new call to these functions. This makes it possible to raise e.g. the used RENDER version again. Signed-off-by: Uli Schlachter <psychon@znc.in>
* Excise xcb-drmChris Wilson2011-07-141-47/+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>
* xlib-xcb: Use slim_hidden_proto correctlyUli Schlachter2011-07-011-0/+6
| | | | | | | | | | | | | | | | There are debug functions for setting the precision on a xlib device, so xlib-xcb must redirect that to the xcb backend, too. However this means that these public functions now are also called internally, thus we have to make them go through the slim_hidden_* macros. This commit fixes the following error from "make check": Checking .libs/libcairo.so for local PLT entries 00000000002bb6d8 000001e300000007 R_X86_64_JUMP_SLOT 000000000006d8a0 cairo_xcb_device_debug_set_precision + 0 00000000002bb750 0000025e00000007 R_X86_64_JUMP_SLOT 000000000006d8b0 cairo_xcb_device_debug_get_precision + 0 FAIL: check-plt.sh Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Initialize the new precision fieldsUli Schlachter2011-06-241-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>
* xcb: Don't hardcode the RENDER version numberUli Schlachter2011-06-241-1/+1
| | | | | | This now uses the macros XCB_RENDER_{MAJOR,MINOR}_VERSION which xcb defines. Signed-off-by: Uli Schlachter <psychon@znc.in>
* perfChris Wilson2011-06-021-0/+9
|
* xlib,xcb: Force strict adherence to the Render specification when testingChris Wilson2011-06-011-0/+20
| | | | | | | | | | Introduce cairo_xlib_device_debug_set_precision() to override the automatic selection of rendering precision and force the Xorg/DDX to strictly adhere to the precise rendering mode of the Render specification. This allows us to test drivers without worrying, too much, about minor discrepancies in antialiasing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* xcb: Remove some unused codeUli Schlachter2011-02-281-22/+0
| | | | | | | All of these defines where not used anymore and this '#if 0'd code was so for ages and most likely would stay commented out for more ages, too. Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Document all public functionsUli Schlachter2011-01-261-0/+26
| | | | | | | 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>
* XCB: Make sure SHM memory isn't reused too earlyUli Schlachter2011-01-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit delays the return of a SHM area to the free pool. When _cairo_xcb_shm_info_destroy is called, it now adds the cairo_xcb_shm_info_t to a list of pending memory areas and sends a GetInputFocus request to the server. This cairo_xcb_shm_info_t is only really freed when the GetInputFocus request completes. To avoid unnecessarily waiting for the X server, we check via xcb_poll_for_reply for the reply which returns immediately if the reply isn't received yet. This commits fixes a race where the shared memory area is reused before the X server finished reading data from it. This does NOT fix races where cairo draws something new to the same cairo_xcb_shm_info_t while the X server still reads from it. However, there doesn't seem to exist any code currently where the shm info isn't immediately destroyed after it was used. This commit fixes the following tests for xcb-render-0.0 if SHM is enabled: joins mask mask-transformed-image push-group push-group-color radial-gradient radil-gradient-mask radial-gradient-mask-source radial-gradient-one-stop radial-gradient-source smask smask-mask smask-paint This also fixes mesh-pattern-transformed for all the xcb boilerplate "backends". Signed-off-by: Uli Schlachter <psychon@znc.in>
* XCB: Stop taking the xcb socketUli Schlachter2010-12-251-41/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* xcb: Return the status upon flushing the device.Chris Wilson2010-06-191-2/+3
| | | | The vfunc was updated to expect the status return, so supply it.
* xcb: trivial memfault fixes.Chris Wilson2010-05-101-17/+40
| | | | | The first fixes required to kick-start memfault testing of the xcb backend.
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* xcb: Relinquish the xcb connection on finish.Chris Wilson2010-03-231-0/+7
|
* xcb: Consume the implicit reference for the cached connection on finishChris Wilson2010-03-221-0/+5
|
* xcb: Make shm optionalChris Wilson2010-01-251-4/+18
| | | | | | Trying to build xcb on a system without SHM wrapped by xcb. The right answer would be to build libxcb-shm. The quick answer is to compile out shm support.
* xcb: compile errors with lockdepChris Wilson2010-01-251-3/+3
| | | | | After moving the mutex to the superclass, I forgot to update the references from the lockdep asserts.
* xcb: Refresh.Chris Wilson2010-01-221-0/+867
Still an experimental backend, it's now a little too late to stabilise for 1.10, but this should represent a major step forward in its feature set and an attempt to catch up with all the bug fixes that have been performed on xlib. Notably not tested yet (and expected to be broken) are mixed-endian connections and low bitdepth servers (the dithering support has not been copied over for instance). However, it seems robust enough for daily use... Of particular note in this update is that the xcb surface is now capable of subverting the xlib surface through the ./configure --enable-xlib-xcb option. This replaces the xlib surface with a proxy that forwards all operations to an equivalent xcb surface whilst preserving the cairo-xlib API that is required for compatibility with the existing applications, for instance GTK+ and Mozilla. Also you can experiment with enabling a DRM bypass, though you need to be extremely foolhardy to do so.