If cairo-drm-intel-brw-eu.h and/or cairo-drm-intel-brw-structs.h are
intended to be private headers, then the change to include cairo.h can
be dropped but the headers should be renamed *-private.h to conform with
Cairo standards.
I'm not certain why check-preprocessor-syntax.sh started flagging these
issues, as it doesn't look like there's been changes to them recently.
But the release scripts won't move forward without these being fixed.
If we cannot let the X11 server do some operation (for example: the
RENDER extension is not available), then we fall back to an image
surface and do the operation locally instead. This fallback requires the
current content of the surface to be downloaded from the X11 server.
This fallback logic had an error.
The fallback is implemented with _get_image() in the function
_cairo_xcb_surface_fallback(). _get_image() is only called if we do not
yet have a fallback available, so when we call _get_image we have
surface->fallback == NULL. Then, if _get_image() fails, it returns a
surface in an error state.
Before this patch, the code would then just ignore this error surface
and return &surface->fallback->base, a NULL pointer. This would then
quickly cause a crash when e.g. the surface's ->status member is
accessed.
Fix this by returning the error surface instead as the fallback.
The end result of this patch will be that the XCB surface that is
currently drawn to ends up in an error state which is a lot better than
a NULL pointer dereference and actually correct in this case. The error
state is reached because the current drawing operation will fail and
this error is reported up the call stack and eventually "taints" the
surface.
(However, the error code could be better: _get_image() too often fails
with a generic CAIRO_STATUS_NO_MEMORY error, but that's left as future
work)
Signed-off-by: Uli Schlachter <psychon@znc.in>
Given a combination of a large scaling matrix and a large line, we can
easily generate a half line width that is unrepresentable in our 24.8
fixed-point. This leads to spurious errors later, such as generating
negative height boxes, and so asking pixman to fill to infinity. To
avoid this, we can check for overflow in calculating the half line with,
though we still lack adequate range checking on the final stroke path.
References: https://bugs.webkit.org/show_bug.cgi?id=16793
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: magomez@igalia.com
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
The index 0 is a legitimate index used for character codes that do not
correspond to any glyph in the font. Instead, the API reserves 0xFFFF
(kCGFontIndexInvalid) as the invalid index and defines 0xFFFE
(kCGFontIndexMax = kCGGlyphMax) as the maximum legal index.
Fixes text-glyph-range.
Truncating the UCS4 representation to 16 bits only works for the Basic
Multilingual Plane, the other characters must be translated to a
surrogate pair.
Fixes smp-glyph.
Reported-by: Clerk Ma <clerkma@gmail.com>
Unicode characters in the Supplementary Multilingual Plane are encoded
as surrogate pairs in UTF-16. This test tries to verify that backends
do not perform UCS4 to UTF-16 conversion by truncation.
These typedefs and defines are part of the libdrm API and therefore should
be taken from there, instead of own redundant declarations.
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
[Call to this was dropped in bd672d08 in favor of intel_bo_map()]]
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
In short, cairo_surface_create_similar inherits it, while
cairo_surface_create_similar_image doesn't. It wasn't obvious without
reading the code or explicitly checking the device scale of the new
surface.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99094
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
The code here wants to ignore errors for a specific request. To do so,
it sets a no-op error handler. However, it could happen that some
previous request caused an error and this error will also be ignored by
the no-op error handler.
To avoid this, call XSync() before setting the error handler. This makes
sure that all pending errors are handled.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
The code for extracting font glyphs was replaced in
70cc8f250b with an implementation based
on CoreText, which is not available on MacOSX 10.4. This commit
restores automatic detection of which API should be used by means of
dynamic linking.
To support differentiating between GLES v2 and v3, rename the flavor
enum to be version specific, as CAIRO_GL_FLAVOR_ES2.
Then, when GLES v3 support is introduced we can add it as a distinct
flavor enum (i.e. CAIRO_GL_FLAVOR_ES3).
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
On systems using GNU's strings implementation, 'strings -' causes a scan
of the whole file, which is equivalent to 'strings -a'. However, in
POSIX passing '-' as the first argument to 'strings' is declared
unspecified, and thus may break the build on systems that use a
different POSIX strings implementation.
Patch from Jung-uk Kim
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88639
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
"This function returns the type a pattern." is obviously missing 'of',
but this can be stated more succinctly with active voice.
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
"can be get" is incorrect grammar; "can be gotten" would be better, but
active voice is best.
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
The cairo_tag_begin/cairo_tag_end API is for supporting hyperlinks and
creating tagged PDF files.
The source, ctm, and stroke style are passed to the backend to allow
these parameters to be used to specify hyperlink border attributes.
Adobe PhotoShop generates CMYK JPEG files with inverted CMYK. When a
JPEG file with this format is included in a PDF file, a `/Decode`
array must be included to convert to "normal" CMYK.
These JPEG files can be detected via the presence of the APP14 "Adobe"
marker. However, PDF viewers are not required to detect and handle
this private marker, so it must be detected and handled (by adding a
`/Decode`) by the PDF generator.
Signed-Off-By: Peter TB Brett <peter.brett@livecode.com>
Some debugging functions wrote to stdout, which is inconsistent with
the other debugging functions of the same groups.
Instead they should write to the debugging file that they are given as
input.
Reviewed-by: Andrea Canciani <ranma42@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227
Invoking cairo_surface_mark_dirty () on an observer surface would
cause it to print debugging output to stdout.
Reviewed-by: Andrea Canciani <ranma42@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227