| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
_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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is broken since:
commit b1192beac7c5b56a8ff356d20af5ebfb65404109
Author: Adrian Johnson <ajohnson@redneon.com>
Date: Mon Sep 21 21:35:05 2015 +0930
Don't cull very thin lines on vector surfaces
On vector surfaces, use a minimum line width when calculating extents.
Bug 77298
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
| |
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
| |
Map allocates a surface. Symmetrically, unmap should destroy it.
|
|
|
|
|
| |
This makes it easier to check that the funciton is returning the
correct type of surfaces.
|
|
|
|
|
| |
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
| |
There was a typo in commit 2061cd81f26.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
| |
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
| |
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cairo_surface_unmap_image() destroys the image that was passed to it. Since
xlib-xcb calls cairo_surface_unmap_image() again for the underlying xcb surface,
the surface was destroyed twice.
Work around this problem by incrementing the image's reference count via
cairo_surface_reference().
No idea why I didn't catch this problem when implementing these functions, I'm
sure I ran the relevant tests. :-(
lt-cairo-test-suite: cairo-surface.c:853: cairo_surface_destroy: Assertion
`((*&(&surface->ref_count)->ref_count) > 0)' failed.
Fixes: map-to-image-fill map-bit-to-image map-all-to-image
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
| |
This implements create_similar_image, map_to_image and unmap.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
| |
a69335a84eb9225b477cc8c753470eb3805b852c introduced some new members
in the backend structure, but quartz, qt and xlib-xcb were not
updated.
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was introduced in b132fae5e843c329d14.
Fixes warnings of the following kind:
cairo-xlib-xcb-surface.c:261:5: warning: initialization from incompatible
pointer type
cairo-xlib-xcb-surface.c:261:5: warning: (near initialization for
'_cairo_xlib_xcb_surface_backend.paint')
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the xlib-xcb backend created a new cairo_device_t for a Display*, it called
XAddExtension to get a callback on XCloseDisplay(). However, when the last
surface using this device is destroyed, this extension isn't unregistered
because there is no API for this.
I noticed that gvim was quite slow after a while with xlib-xcb. The reason is
that xlib has a linked list of registered extensions that it has to walk through
for various callbacks. Since xlib-xcb caused lots of "dead" extension, this got
quite slow when there were about 20k entries in this list.
The fix is to make sure that the cairo_device_t isn't finished/destroyed when
the last surface using it is destroyed. For this, we keep an internal reference
which is only dropped when the device is finished. This happens when someone
explicitly calls cairo_device_finish or when our XCloseDisplay hook runs.
The same thing is done by cairo-xlib. I didn't port this over to xlib-xcb
because at that time I didn't understand why it was needed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commits makes the xlib-xcb backend produce its own cairo_device_t. This
per-Display* device is used to manage the registration of a XCloseDisplay hook
via XAddExtension/XESetCloseDisplay in the same way that the xlib backend does
this. The device is necessary to see if we already registered an extension.
This fixes weird errors when running cairo-test-suite with -a -s. They were
caused because the backend didn't see the XCloseDisplay and the next
XOpenDisplay happened to create a xcb_connection_t with the same address as the
last display. This caused the xcb backend to assume lots of wrongness.
This commit makes use of _cairo_xlib_display_mutex which is otherwise compiled
in but not used anywhere when xlib-xcb is enabled.
Patch v2: Fixed the xcb_device == NULL case and made sure the xcb_device is only
finished on XCloseDisplay, not when all xlib-xcb surfaces are destroyed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
| |
Instead, this now uses the surface wrapper functions for this job.
These functions make sure that e.g. snapshots are detached and that is_clear is
reset correctly.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
| |
Also, this now sets surface->xcb to NULL after the dereference. Segfaults are
way more prominent anyway. :-)
All the backend callbacks shouldn't need any checks since the public entry point
already checks for finished surfaces. Only the public functions in xlib-xcb need
to do checks for finished surfaces.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function called directly into the xcb's surface flush function. This means
that snapshots for that surface weren't detached since that's normally done in
cairo_surface_flush() before calling into the backend.
Fix this by using surface_flush() instead of calling into the backend directly.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=31931
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the X11 server doesn't have the RENDER extension, the xcb backend falls back
to the image backend in some cases (e.g. create_similar). xlib-xcb didn't handle
this properly which means it used the result like a xcb surface.
Found while debugging https://bugs.freedesktop.org/show_bug.cgi?id=31931,
firefox died from a BadDrawable error when it tried to use the (bogous) result
from cairo_xlib_surface_get_drawable().
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
| |
The functions cairo_xlib_surface_set_size and cairo_xlib_surface_set_drawable
didn't set the expected error when called with a finished surface.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
|
|
|
| |
63bdae27a83381fb8c3786c2d7a6c2592e388ee9 introduced a new public API
cairo_xlib_device_debug_set_precision(), exported by cairo-xlib.
cairo-xlib-xcb must implement it as well, because it must provide the
same public API.
Fixes the compilation of cairo-sphinx with --enable-tee
--enable-xlib-xcb --enable-script.
Reported-by: James Cloos <cloos@jhcloos.com>
|
|
|
|
|
|
|
|
|
|
|
| |
make on win32 complains that:
make[1]: Entering directory `/home/ranma42/Code/fdo/cairo/src'
../src/Makefile.sources:220: *** missing separator. Stop.
Makefile.sources should not contain if's, which are aoutomake-only
conditionals. The correct way to conditionally include files is to
enable/disable them using C preprocessor macros.
|
|
|
|
|
| |
The first fixes required to kick-start memfault testing of the xcb
backend.
|
|
|
|
|
|
|
| |
When choosing the xcb_screen_t to use for the xlib-xcb backing surface,
it helps if it matches the screen used to generate similar surfaces and
snapshots - otherwise we end up pulling the image back from the XServer
every time we want to use the Picture.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=599574
The backend API manipulated the surface prior to checking whether it was
an inert error surface - and in the event of an error surface, tried to
overwrite it's error status.
|
|
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.
|