Commit graph

8972 commits

Author SHA1 Message Date
Chris Wilson
5f2e647dcf drm/intel: Drop the bo cache.
As this remains experimental, rely on the highly experimental kernel
caching...
2010-11-07 14:37:05 +00:00
Uli Schlachter
b4e55b84e2 test/README: Change suggested screen size
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>
2010-11-07 12:54:54 +00:00
Uli Schlachter
95f6f7a174 Make both versions of _cairo_lround consistent again
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>
2010-11-07 12:54:08 +00:00
Uli Schlachter
5d5a7d6b22 _cairo_round: Fix documentation
Despite what the comment says, this function rounds halfway cases towards
positive infinity.

_cairo_round ( 0.5) => floor ( 1.0) =>  1.0
_cairo_round (-0.5) => floor ( 0.0) =>  0.0
_cairo_round (-1.5) => floor (-1.0) => -1.0

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-07 12:53:22 +00:00
Uli Schlachter
6383e1442c XCB: Check screen size in boilerplate
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>
2010-11-07 12:51:56 +00:00
Adrian Johnson
daaef055b5 PDF: Fix toUnicode for CID fonts
1047dc6b introduced a regression for text that is using 16-bit glyphs
in the content stream.
2010-11-07 21:50:56 +10:30
Uli Schlachter
f1d1928d13 xcb: Fix transformation matrix setting
_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>
2010-11-06 17:29:04 +01:00
Andrea Canciani
d51ab09142 configure: Correct reporting of tee backend
Since 9f33f8453b tee is not compiled in
anymore by default. Reporting it as always enabled is misleading.
2010-11-06 15:46:48 +01:00
Adrian Johnson
5906e64000 Type 1 glyph names: Do not use an array of pointers for winansi glyph names
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.
2010-11-06 22:45:11 +10:30
Adrian Johnson
048a43e5c4 Move glyph names into separate file
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.
2010-11-06 22:31:46 +10:30
Adrian Johnson
74873c8224 Fix type1-fallback bbox 2010-11-06 21:15:30 +10:30
Adrian Johnson
8f2f5e5ad4 configure.ac.features: s/Meta/Recording/ 2010-11-06 18:44:54 +10:30
Markus Stange
b53084b7c5 Fix type of _cairo_memory_stream_destroy parameter
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.
2010-11-05 09:25:11 +01:00
Erik Zeek
6dda9c4465 Fix build on gentoo
The problem is probably caused by a change in the behavior of autoconf
(2.67).

See http://bugs.gentoo.org/336329
2010-11-05 09:14:41 +01:00
Adrian Johnson
84a7fe8a5c CFF Subset: Remove debug code 2010-11-02 21:57:15 +10:30
Adrian Johnson
1047dc6b94 PDF: Use correct bfchar size in toUnicode for latin fonts
poppler was printing warnings about the wrong size
2010-11-02 21:57:10 +10:30
Andrea Canciani
c7027c9d89 image: Use correct size for allocation
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).
2010-11-01 21:20:29 +01:00
Andrea Canciani
852e789b75 quartz-font: Do not leak CFDataRef's
CFData is allocated and thus needs to be freed.
2010-11-01 15:53:10 +01:00
Andrea Canciani
947d35c195 quartz-font: Add truetype font table tags accessor
Improves the quality of embedded fonts.
2010-11-01 14:06:32 +01:00
Andrea Canciani
bb30dae210 script: Fix compilation
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).
2010-10-30 13:37:33 +02:00
Andrea Canciani
e43ae00211 cff: Fixes for 'make check'
Fixed some complaints by 'make check' about exported symbols in cff.
2010-10-30 13:36:44 +02:00
Andrea Canciani
22ea4609be path: Solve co-dependency problem
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'.
2010-10-30 13:36:18 +02:00
Andrea Canciani
330b343952 drm: Do not access path flags directly
Fixes compilation
2010-10-30 11:26:13 +02:00
Uli Schlachter
5b2ed2422d xcb: Do not access flags directly
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>
2010-10-30 10:23:16 +02:00
Andrea Canciani
b8444a5c78 path: Tighten transformed extents
The transformation code should produce tight extents if they are to be
used in the new simple extents functions.
2010-10-29 17:31:24 +02:00
Andrea Canciani
89e1261dd0 path-bounder: Simplify code
If the path extents are tight, all the extents computations and
approximations become trivial except for the stroke extents.
2010-10-29 17:31:23 +02:00
Andrea Canciani
958c56e2b4 path: Tighten curve_to extents
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.
2010-10-29 17:31:23 +02:00
Andrea Canciani
0655198301 Fix degenerate arcs
Make sure that degenerate arcs become a move_to-line_to sequence
instead of just a move_to.

Fixes get-path-extents.
2010-10-29 17:31:23 +02:00
Andrea Canciani
a1d8763236 path: Replace _cairo_path_fixed_extents_add with _cairo_box_add_point
Path extents now satisfy _cairo_box_add_point requirements, so it can
be used instead of _cairo_path_fixed_extents_add.
2010-10-29 17:31:23 +02:00
Andrea Canciani
0268706550 path: Fix _cairo_path_fixed_transform
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.
2010-10-29 17:31:23 +02:00
Andrea Canciani
29d5b18cba path: Recompute flags in _cairo_path_fixed_scale_and_offset
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.
2010-10-29 17:31:23 +02:00
Andrea Canciani
634fcf2c0a path: Transform current_point and last_move_to in _cairo_path_fixed_scale_and_offset
They were previously left in their old position (which could lead to
incorrect flag computation if other operations were added to the
path).
2010-10-29 17:31:23 +02:00
Andrea Canciani
9c0e4db570 path: Recompute flags in _cairo_path_fixed_translate
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.
2010-10-29 17:31:23 +02:00
Andrea Canciani
9d84dff0c6 path: Cleanup close_path
Instead of explicitly calling _cairo_fixed_move_to, setting the
needs_move_to flags is sufficient because the current_point is already
updeted correctly.
2010-10-29 17:31:23 +02:00
Andrea Canciani
17fef2fe4d path: Make _cairo_path_fixed_last_op assert on empty path
_cairo_path_fixed_last_op should now only be used on non-empty path
(to test if the previous operation was a line_to).
2010-10-29 17:31:23 +02:00
Andrea Canciani
568a975a62 path: Cleanup _cairo_path_fixed_iter_at_end
The last operation of a path cannot be a move_to anymore (since
move_to is only added if another operation is added after it).
2010-10-29 17:31:23 +02:00
Andrea Canciani
929571b4b5 path: Cleanup _cairo_path_fixed_transform
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.
2010-10-29 17:31:23 +02:00
Andrea Canciani
34f1db13a1 path: Log flags
When logging path operations, also log computed flags.
2010-10-29 17:31:23 +02:00
Andrea Canciani
e8e614db92 path: Rename fill optimization flags
Rename fill optimization flags making fill_ their common prefix.
2010-10-29 17:31:23 +02:00
Andrea Canciani
e48cb95493 path: Add stroke_is_rectilinear flag
Stroke and fill rectilinearity cannot be represented by a single flag
without missing the opportunity of considering some strokes
rectilinear.
2010-10-29 17:31:22 +02:00
Andrea Canciani
166453c1ab path: New path construction logic
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.
2010-10-29 17:31:22 +02:00
Andrea Canciani
a2ac91eb5f path: Drop degenerate line_to in _cairo_path_fixed_curve_to
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.
2010-10-29 17:31:22 +02:00
Andrea Canciani
2352b48f9e path: Move _cairo_path_fixed_add at the end of line_to and curve_to 2010-10-29 17:31:22 +02:00
Andrea Canciani
d6c3451ee2 box: Add _cairo_box_add_curve_to
Add a function to extend a box with the extents of a curve_to
operation.
2010-10-29 17:31:22 +02:00
Andrea Canciani
46584e01a8 box: Add box header
Add a new header implementing very simple box functions:
 - initialization with the two extrema
 - extension with a point
 - in/out test
2010-10-29 17:31:22 +02:00
Andrea Canciani
65d57313f0 path: Cleanup _cairo_path_fixed_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.
2010-10-29 17:31:22 +02:00
Andrea Canciani
f3e7677109 path: Simplify close_path
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).
2010-10-29 17:31:22 +02:00
Andrea Canciani
641d314b9a path: Add utility functions
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.
2010-10-29 17:31:22 +02:00
Andrea Canciani
4075ed9686 path: Rename _cairo_path_last_op to _cairo_path_fixed_last_op
Aestetical change, to make the naming consistent with that of the
other functions.
2010-10-29 17:31:22 +02:00
Andrea Canciani
a8763d8fde path: Make path equality independent of flags
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).
2010-10-29 17:31:21 +02:00