Const-ify where appropriate and make all index and element counts
unsigned int.
This is needed to enable accessing const cairo_array_t's without
having to manually remove the const qualifier (which happens in the
to-be-merged mesh pattern code, for example).
It is sometimes useful to read the elements of a const cairo_array_t,
but it is currently only possible by ignoring the const qualifier.
The _cairo_array_index_const function allows read-only access to the
array elements.
This is needed to enable accessing const cairo_array_t's without
having to manually remove the const qualifier (which happens in the
to-be-merged mesh pattern code, for example).
Array snapshots are not used anymore and just bloat the implementation
of cairo_array_t.
In particular, double indirection was needed to implement array
snapshots, as explained in c786853993.
Painting of some pattern was broken because the paint operation was
implemented as a fill to a rect containing the clip, but this rect was
not transformed as appropriate (using the cairo_to_ps matrix).
PDF simply fills the whole surface rect, so we implement the same
behavior in PS.
Fixes clip-group-shapes-circles, clip-stroke, linear-gradient-extend,
linear-gradient-one-stop, radial-gradient-one-stop.
There were some difference between how the FT and Win32
load_truetype_table font backend functions worked due to the
difference between FT_Load_Sfnt_Table() and GetFontData(). eg FT
returns an error if less than the requested number of bytes could be
read while Win32 returns success and sets the length to the number of
bytes read.
Make the default case be an assert to catch a silly programming error
and silence the compiler:
cairo-pdf-operators.c: In function ‘_word_wrap_stream_write’:
cairo-pdf-operators.c:300: warning: ‘count’ may be used uninitialized in
this function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the font has been synthesized we can't use the native subsetters as
the outlines won't be the same. Instead force the use of the fallback
subsetters so the synthesized outlines will used to generate the font.
One of the problems identified in
https://bugzilla.mozilla.org/show_bug.cgi?id=454532 is that there are
some older printer drivers that do not work with ExtTextOut and the
ETO_GLYPH_INDEX option.
Fix this by where possible mapping glyph indices back to unicode and
calling ExtTextOut without ETO_GLYPH_INDEX. Glyphs that can not be
mapped back to unicode are printed with ETO_GLYPH_INDEX.
Similar to the freetype and toy font backends, use a hash table
to map logfont,hfont to font faces.
This fixes the multiple embedding of the same font in PDF.
https://bugs.freedesktop.org/show_bug.cgi?id=24849
The issue is that we store our data flipped based on whether we're
rendering to an FBO or to a window. By not flipping our gl_FragCoord
usage based on that (either with math or ARB_frag_coord_conventions),
this caused linear gradients to be flipped when rendering either to a
window or to an FBO. To avoid this, pass in appropriate texcoords.
And, if we're passing in texcoords, just do the projection to the
linear gradient factor on the CPU side per vertex instead of providing
a bunch of uniforms to do the math per fragment.
Fixes 18 testcases.
The use of ActualText in a marked content sequence is a PDF 1.5
feature.
A 'use_actual_text' flag linked to the PDF version has already been
implemented in pdf-operators but for some reason this flag had not
been used to control the use of ActualText.
The dash-state test needs a surface with a width of 1500 pixels. If the screen
size is smaller than that, the boilerplate backends that create a window on the
X server can't properly do their job because part of the window would be outside
of the screen. This means people should use a screen large enough for all the
needed test surfaces. 1680 seemed like a more-or-less realistic value here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Commit c0008242b0 made cairo use libm's lround instead of its own _cairo_lround
by default. However, since commit ce58f874 from 2006, _cairo_lround does
arithmetic rounding instead of away-from-zero rounding (before said commit, it
was using baker's rounding).
So to make the rounding of _cairo_lround be independent from
DISABLE_SOME_FLOATING_POINT, we have to use another function. Turns out that
_cairo_round already does the same thing that _cairo_lround does. Their only
difference is the return type.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Trying to create a window for drawing that is larger than the available screen
space is a bad idea. When the test finishes and tries to grab the resulting
image from the X server, the window's area that is outside of the screen will
have undefined content.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
_cairo_xcb_picture_set_matrix() checked if the matrix that it should
set is an identity matrix. In this case this function simply didn't do
anything at all. The assumption here seems to be that a picture's
matrix is the identity matrix by default.
The problem here is that we might first set a picture's matrix to
something else and then later need an identity transform again. Fix
this by still setting the new matrix if it is an identify matrix. We
just skip some unneeded checks and optimizations in this case.
This fixes the "finer-grained-fallbacks" test in the test suite.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Similar to ps_standard_encoding array, use a string pool and lookup
indices for the winansi glyph names to reduce .data size. As
ps_encoding and winansi share mostly the same names, the perl script
has been modified to merge the symbols into the one string pool and
generate separate lookup indices for ps_encoding and winansi.
The latin subsets feature requires these names. As
cairo-type1-subsets.c depends on FreeType, move these names out to a
separate file to allow compilation without FT.
In 9b9952ab4f
_cairo_memory_stream_destroy was changed to take an unsigned long
instead of unsigned int, and the two callsites in cairo-gl-shaders.c
weren't updated.
In 06e9caf861 the type of the variables
was changed, but the type used to compute the allocation size was not.
Fixes a crash in user-font-mask (test-fallback backend).