| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A little history digging shows that we only ever had one caller of
_cairo_tee_surface_find_match. Commit 658cdc7c9a "Introduce
cairo_tee_surface_t" added this code to _cairo_surface_clone_similar():
if (src->type == CAIRO_SURFACE_TYPE_TEE) {
cairo_surface_t *match;
match = _cairo_tee_surface_find_match (src,
surface->backend,
content);
if (match != NULL)
src = match;
}
Then, two years later in 2011, commit af9fbd176b1 "Introduce a new compositor
architecture" removed _cairo_surface_clone_similar() and thus this code became
unused.
This commit drops this unused code.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
|
| |
This implements Type 3 color fonts for PDF for any font with a
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE. This includes user-fonts,
SVG fonts, and COLR fonts.
Glyphs with foreground colors are not yet implemented as Type 3 glyphs
and will be rendered as images by cairo-surface.
|
|
|
|
| |
as it is used by FT as well as user fonts.
|
|
|
|
|
|
|
| |
The surface code was optimizing away show_text_glyphs
based on the operator when the source pattern is clear.
But if we are rendering color glyphs, that is not
correct since we are using the glyphs as source.
|
|\
| |
| |
| |
| | |
Fix svg renderer crash
See merge request cairo/cairo!416
|
| | |
|
|/ |
|
|
|
|
|
| |
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/616
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
| |
|
| |
|
|
|
|
|
|
| |
and split _cairo_user_scaled_glyph_init() into multiple functions.
Update user-font test to test changing foreground text color.
|
|\
| |
| |
| |
| |
| |
| | |
Fix rendering of color glyphs on a clear surface
Closes #539
See merge request cairo/cairo!283
|
| |
| |
| |
| |
| |
| |
| |
| | |
We were calling the backend vfuncs directly, thereby
missing some of the surface state bookkeeping that
is done in the wrappers.
Fixes: #539
|
|\ \
| | |
| | |
| | |
| | | |
Paint color glyphs in fallback resolution on vector surfaces
See merge request cairo/cairo!293
|
| |/ |
|
| |
| |
| |
| | |
to prevent asserting in _cairo_scaled_font_freeze_cache()
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
| |
When rendering clusters that have colored and non-colored
glyphs, we were falling back to using show_text_glyphs,
rendering all glyphs in the cluster without color.
Instead, make composite_one_color_glyph smart enough
to handle non-color glyphs, and only skip clusters
that are entirely non-color.
Testcase: hb-view AmiriQuranColored.otf -u 627,64e
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the run contains a mix of color and non-color
glyphs, composite_color_glyphs returns the non-color
glyphs unhandled in the same array. In the rtl case,
the glyphs are processed from the end and the unhandled
glyphs are accumulated at the end as well, and we
need to move them to the beginning of the array before
we return. Add the missing memmove call to do that.
Fixes: #533
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
COLR fonts can have a layer with the same color as the current text
color. This change passes the current color (if solid) through to
the font backend where it can be used to render color fonts.
scaled_glyph_lookup checks if the foreground color has changed (for
glyph that require it) and requests a new color surface if required.
This also fixes a bug where scaled_glyph_lookup would always request a
color surface for glyphs for glyphs in color fonts that do not have
color.
|
|\
| |
| |
| |
| | |
Fix compositing non-color glyphs in one case
See merge request cairo/cairo!224
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The intention here is: "if show_text_glyphs is unsupported,
try show_gyphs". We need to make sure to set the status to
unsupported before checking it, otherwise we end up looking
at the status that was set by composite_color_glyphs if
show_text_glyphs is NULL.
This showed up in https://github.com/harfbuzz/harfbuzz/issues/2675
|
| | |
|
|/
|
|
|
| |
Adds new API cairo_user_font_face_set_render_color_glyph_func()
to set a color glyph renderer.
|
|
|
|
|
| |
The gstate is not required and was causing some tag operations to be
ignored.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit 10e58a4a I changed the code in cairo-surface.c to avoid
setting surface->is_clear = FALSE; in some situations where it was not
necessary, because the operation did not actually modify anything (it
returned CAIRO_INT_STATUS_NOTHING_TO_DO). However, that change
accidentally also caused _cairo_surface_paint() not to set
surface->is_clear = TRUE; in similar cases. That was unintended.
This commit fixes that by always setting is_clear = TRUE when necessary,
but keeps the optimisation of not setting is_clear = FALSE when not
necessary.
The connection to the below issue is that the issue happened with
surfaces with width=0. Clearing such a surface with CAIRO_OPERATOR_CLEAR
causes CAIRO_INT_STATUS_NOTHING_TO_DO and thus is_clear = TRUE was not
set. This error was later caught by a failed assertion.
Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/283
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|\ |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
We can't just move around the contents of the
passed-in string, we need to make a copy. This
was showing up as memory corruption in pango.
See https://gitlab.gnome.org/GNOME/pango/issues/346
|
|
|
|
| |
Issue 357
|
|
|
|
|
|
|
|
|
|
| |
_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>
|
|
|
|
| |
We were forgetting to free the pattern here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a color glyph is completely clipped away, we
get the non-zero status 'nothing to do'. In that case,
we must not exit early, since there might still be work
to do for the other color glyphs.
This bug was showing up as color glyphs stopping to render
in GTK+ entries that are scrolled to the right, and also
as color glyphs not rendering inside the selection sometimes.
See https://bugzilla.gnome.org/show_bug.cgi?id=790255 and
https://bugzilla.gnome.org/show_bug.cgi?id=788071.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Restructure the emit_surface code so that mime types are checked first.
- Add a test parameter to emit_surface to test if the surface will be emitted
as an image or recording instead checking the surface type as the attached
mime may override this.
- Mark surface as not clear when mime is attached to avoid optimizing away
"clear" surfaces that have mime attached.
- Include entire surface in analysis if mime attached (also fixes bug with
calculating the extents CONTENT_COLOR surfaces)
|
|
|
|
|
|
| |
PDF XObjects need to specify the bounding box. Emit unbounded surfaces
when finishing as at this point the extents of all uses of the
unbounded surface are known.
|
|
|
|
|
|
|
|
|
|
|
| |
This completes the full set of PDF/PS image filters allowing image
data to be passed though without decompressing then recompresssing in
a less efficient format.
The difficulty with CCITT_FAX is it needs some decoding parameters
that are not stored inside the image data. This is achieved by using
an additional mime type CCITT_FAX_PARAMS that contains the params in
key=value format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In cairo, most operators are composited this way:
((src IN mask) OP dst) LERP_clip dst
but SOURCE and CLEAR operators are composited this way:
(src OP dst) LERP_(clip IN mask) dst
(why is this not specified anywhere in the docs or source tree?)
With color glyphs, we were not special-casing SOURCE and CLEAR.
We do now.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=102661
|
|
|
|
|
|
| |
Spotted by David Kastrup <dak@gnu.org>.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Do away with the separate check for color glyphs - we can just
do the filtering, and if there are no color glyphs, it is a
no-op. As long as we only do this for fonts with color glyphs,
it should be fine.
Reduce repetition in composite_color_glyphs by breaking out
some helper functions.
|
|
|
|
|
|
|
|
| |
Use paint instead of show_glyphs for color glyphs. To avoid
overhead, we only check for color glyphs if the font is known
to contain any. Paint clusters containing only color glyphs
and rewrite the inputs to remove the handled clusters and
glyphs.
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99094
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
| |
"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.
|
| |
|
| |
|