Commit 503b6b9e2e added a check_composite method to the mask compositor, but
only added it to one of the existing implementations. This commit fixes that.
In cairo-image-compositor.c, there is already a check_composite method which
just returns success for the traps compositor. This commit makes the mask
compositor use that one.
I don't want to say much about cairo-image-mask-compositor.c except that I
wondered why this file and the file above both define a non-static function
called _cairo_image_mask_compositor_get(). In my opinion, that file should just
be deleted, since it confuses e.g. ctags, but I'll let someone else clean this
up.
Fixes 493 crashes in the test suite for the test-mask target.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Tested-by: Bryce Harrington <b.harrington@samsung.com>
_cairo_clip_intersect_box() wasn't checking if it was called with the special,
read-only all-clipped clip and thus could have ended up writing to read-only
memory.
References: https://bugs.freedesktop.org/show_bug.cgi?id=75819
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fixes crash in pixman_image_composite32().
Originally fixed by Yoshitaro Makise.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Escape PostScript names of loaded fonts. These can not
contain white spaces and delimiter characters when saving
them to a PostScript file or a PDF file.
Similar to 1f4d05b55c
'Fix calling '_cairo_spline_intersect' for in-bounds checking of splines'
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
The function color_to_pixel() can fail for unsupported pixman image formats, but
fill_reduces_to_source() ignored this possibility.
Fix this by using the return value of color_to_pixel():
Fixes the following compiler warnings:
cairo-image-compositor.c: In function 'fill_boxes':
cairo-image-compositor.c:349:15: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized]
cairo-image-compositor.c: In function 'fill_rectangles':
cairo-image-compositor.c:304:18: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of expecting awk in /usr/bin, this commit changes the code to call awk
through a shell so that $PATH is searched.
Since this awk script shouldn't really be called manually, this is done by
removing the shebang from the awk script, marking it non-executable and fixing
up the caller.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67674
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions
were added in glib 2.14 and thus cairo needs at least this version for its
gobject helper functions.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239
Signed-off-by: Uli Schlachter <psychon@znc.in>
Based on a patch and analysis by Michael Henning.
When we create a similar-image surface for win32, we set up a couple of
back references from the image to the win32 surface, and vice versa. We
need to be careful when decoupling the reference cycle to avoid chasing
around the loop upon destruction. Currently we handled destroying the
similar-image via the parent win32 surface, but similar precaution is
required when destroying the surface via the similar-image.
Reported-by: Michael Henning <drawoc@darkrefraction.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63787
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When creating a texture surface that is larger than the maximum
framebuffer or texture dimensions of the context, return a surface in
error. Previously the code failed an assertion, but this prevents an
application from easily detecting when to fall back.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This fixes a crash in the api-special-cases with xlib-xcb when calling
cairo_clip_extents() on a context that refers to a finished surface.
The crash was a simple NULL pointer dereference, because the underlying xcb
surface that was used in xlib-xcb was gone and set to NULL already.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Make cairo_push_group() fail when the context's target surface is finished.
This fixes the api-special-cases for the xcb backend:
Detected error during xcb run: error=9, seqno=0x13c, major=53, minor=0
The problem was that the Pixmap for the cairo surface was already freed and
cairo still tried to use it again as the drawable in a CreatePixmap request.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Finished surfaces and surfaces with an error status must not be usable anymore,
so refuse to work on them.
This improves the result for api-special-cases.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68014
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds code to the api-special-cases test which also tests the behavior of
cairo when the cairo context or the surface that is target is in an error state
or finished. These new tests call into all public entry points defined in
cairo.h which receive a cairo_t * as their first argument.
Currently this causes a new crash in the testsuite:
cairo-surface.c:394:
_cairo_surface_begin_modification: Assertion `! surface->finished' failed.
Reported-by: christophe.troestler@umons.ac.be
References: https://bugs.freedesktop.org/show_bug.cgi?id=68014
Signed-off-by: Uli Schlachter <psychon@znc.in>
The macro benchmarks were moved to a separate repository some time ago,
but the perf README still refers to these tests as if they were still
present, which may lead to some confusion. Instead, consolodate the
macro benchmark documentation with the macro benchmarks, and focus this
README on just the (still in tree) micro-benchmarks.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
When the latin subset contains glyphs that use the seac operator to
combine two glyphs, additional non winansi glyphs are added to the
subset. These extra glyphs do not have a winansi name so they can't
be renamed.
Based on a patch by Salvador Ortiz.
Bug 67324
When blitting the framebuffer during transitions to and from
multi-sampling mode, we need to disable the stencil and scissor test so
that the entire surface is preserved. This fixes the bitmap-font test
for the MSAA compositor.
If subpixel rendering is enabled, but FT returns a 8bit gray bitmap
(perhaps because the font has 8bit embedded bitmaps) we were hitting
the assertions because the assumptions made were wrong. Fix up.
In some obscure conditions that I don't really understand, the image compositor
did not finish a span renderer that it created. This could then cause the last
row of the span to be ignored.
Fixes: clip-complex-bug61492
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61592
Signed-off-by: Uli Schlachter <psychon@znc.in>