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).
Use accessors instead of directly accessing path optimization flags.
Change the conditions for outputting tolerance (was 'when
path->is_rectilinear is FALSE', now is 'whenever the path includes a
curve').
Always output tolerance for strokes, because pen depends on tolerance
(for round caps/joins and for cusps).
FALSE and TRUE are defined in cairoint.h, but cairoint.h depends on
cairo-path-fixed-private.h, so just use 0/1 to avoid the depencency
loop.
Fixes a number of errors reported by 'make check'.
This fixes compilation of the xcb backend by porting commit e9c1fc31887c5bfbb's
changes from the image backend.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The additional time spent in the computation of tight extents for the
curve_to operation doesn't seem to be significant, but it makes the
extents computations faster and the approximations more accurate.
current_point and last_move_to were previously left in their old
position (which could lead to incorrect flag computation if other
operations were added to the path) and flags were not updated.
Only fill_maybe_region can change its value because the transformation
preserves vertical and horizontal lines, but can move the points and
make them integer if they were not or non-integer if they were.
Recomputing it is just as easy as checking if all the points are
integer and the path is fill_is_rectilinear.
Only fill_maybe_region can change its value because the transformation
preserves vertical and horizontal lines, but can move the points and
make them integer if they were not or non-integer if they were.
Recomputing it is just as easy as checking if all the points are
integer and the path is fill_is_rectilinear.
Instead of explicitly calling _cairo_fixed_move_to, setting the
needs_move_to flags is sufficient because the current_point is already
updeted correctly.
Clean up the code and make sure that _cairo_path_fixed_translate is
used whenever the _cairo_fixed_to_double rounding would result in the
matrix being approximated with a translation.
Now move_to's are actually added to the path when followed by a
drawing operation (line_to, curve_to or close_path).
This is implemented by updating the current_point and setting the
needs_move_to when a move_to operation is requested.
Whenever a drawing operation is requested and the needs_move_to flag
is set, a move_to is added before the drawing operation.
When a degenerate line_to is followed by a curve_to operation, the
line_to can be safely dropped, just like for degenerate line_to
followed by line_to.
The low-level line_to optimizations can be implemented in a more
abstract way using _cairo_path_fixed_penultimate_point and
_cairo_path_fixed_drop_line_to.
Instead of explicitly computing the flag in close_path, manually close
the path with a line_to, then drop the last operation if it is a
line_to (it might be another operation if the line_to was ignored
because it would have been degenerate).
Add a function to get the penultimate point and another one to drop
the last operation (assuming it is a line_to).
This allows some more abstraction in the line_to and close_path code.
Flags for the same path can be different depending on its "history"
(in particular if it was constructed and transformed they might be
different from what they would be if each point was transformed and
then the path constructed).