Commit graph

8949 commits

Author SHA1 Message Date
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
Andrea Canciani
f4b2ce1c78 path: Improve hashing
Make the hash independent of buf bucketing, extents and flags.

This makes the hash depend only on the actual content of the path, not
on how it is stored or on any computed property.
2010-10-29 17:31:21 +02:00
Andrea Canciani
e9c1fc3188 path: Do not access flags directly
Use inline accessors to hide the flags in the code.

This ensures that flags that need additional computations (example:
is_rectilinear for the fill case) are always used correctly.
2010-10-29 17:31:21 +02:00
Andrea Canciani
14cc9846b3 path: Replace _cairo_path_fixed_is_equal with _cairo_path_fixed_equal
Remove _cairo_path_fixed_is_equal and use _cairo_path_fixed_equal
instead.
The latter function can recognize that two paths are equal even if the
drawing commands have been partitioned in a different way in the buf
list.
2010-10-29 17:31:21 +02:00
Andrea Canciani
ac7b2a9720 test: Fix get-path-extents
The test was considering all the empty rects equals, but this is
not correct when testing the results of cairo_path_extents().
2010-10-29 17:31:21 +02:00
Chris Wilson
253374d6ad configure: Remove noisy -Wlogical-op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-29 15:00:03 +01:00
Benjamin Otte
5a762edc28 build: Don't build cairo-fdr when the tee surface is off 2010-10-28 14:00:24 +02:00
Adrian Johnson
e23bcfd430 PDF: Don't use the currently set color after a 'Q' operator
https://bugs.freedesktop.org/show_bug.cgi?id=31140
2010-10-28 21:21:00 +10:30
Andrea Canciani
147fa7a2be test: Add romedalen images copyright information
romedalen.png and romedalen.jpg have been bundled into the test
suite without an explicit copyright notice.
2010-10-24 16:40:53 +02:00
Adrian Johnson
6dc0b19adb Type 1 subset: Fix glyph advance
https://bugs.freedesktop.org/show_bug.cgi?id=31062
2010-10-24 11:32:41 +10:30
Uli Schlachter
cee1dadc66 Other backends: Set round_glyph_positions to OFF
This sets CAIRO_ROUND_GLYPH_POS_OFF in all surface backends that didn't use
CAIRO_ROUND_GLYPH_POS_ON.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 22:20:31 +02:00
Uli Schlachter
d24e9881de raster backends: Set round_glpyh_positions to ON
This fixes "text-rotate" in the test suite for the image backend and
"overlapping-glyphs" for the xcb backend.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 22:20:31 +02:00
Uli Schlachter
b514863a0e Actually implement round_glpyh_positions
The previous commit only added this option and made sure it gets set, but it
didn't actually have any effect. This commit now implements this option.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 22:20:31 +02:00
Uli Schlachter
6bfe71124b font options: Add private round_glpyh_positions field
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 22:20:12 +02:00
Uli Schlachter
fae88051c1 XCB: Use consistent rounding modes for a1 rasterisation.
This ports commits 36b4b0631 and 7ab9ce1b9 from the image backend to xcb. Look
there for an explanation of why this is correct, I only copied this over and the
test suite said it was good. :-)

This fixes unantialiased-shapes, a1-rasterisation-rectangles and
a1-rasterisation-triangles.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 12:18:27 +01:00
Uli Schlachter
b80bcf66b2 XCB: Fix for all unbounded operators
_cairo_xcb_surface_fixup_unbounded_boxes() calculated a list of boxes that it
has to clear to make an unbounded operator work correctly. Then it cleared the
boxes that were drawn instead of clearing the list of boxes that it has to
clear.

The reason that this wasn't noticed before is that there is an optimization in
case we have only one box instead of a whole list of boxes. This hid the bug.

This fixes the "unbounded-operator" test case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 12:18:27 +01:00
Uli Schlachter
4465ff779a XCB: Move the assert from 5a0f8f7320
Calling _cairo_xcb_surface_ensure_picture() on a XCB surface whose fallback
member is non-null is always an error. It's possible that the surface first gets
a picture assigned and later it's fallback member is set. In this situation,
it's still wrong to use the surface's picture for any drawing-

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-21 12:18:27 +01:00
Chris Wilson
c6c3bdba4b perf: Only print description once per backend
Currently we print the backend description before every time, which is
overly verbose. As the information doesn't^Wshouldn't change, simply
print it before running the first test of each target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-20 14:26:37 +01:00
Chris Wilson
0d93468efc xcb: Pass clip to composite_glyphs_via_mask
Spotted by Uli Schlachter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-15 10:40:53 +01:00
Chris Wilson
42ecc427f3 xcb,image: Fix a missing clip fini
Spotted by Uli Schlachter when I copied the image glyphs clipping to
xcb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-15 10:40:53 +01:00
Adrian Johnson
22cdb7041f PS: Remove radial gradient fallback
when one circle not inside the other. Pixman now follows the PDF
specification.
2010-10-15 15:26:39 +10:30
Adrian Johnson
d3655e04b2 PDF: Remove radial gradient fallback
when one circle not inside the other. Pixman now follows the PDF
specification.
2010-10-15 15:26:39 +10:30
Adrian Johnson
34d9299624 PS: Remove redundant code
The test for zero stops is now in gstate.
2010-10-15 15:26:39 +10:30
Adrian Johnson
7a17ef3176 PDF: Fix regression in EXTEND_NONE gradients
The test for opaque gradients in _cairo_pdf_surface_add_pdf_pattern()
must be identical to the test in
_cairo_pdf_surface_emit_pattern_stops() other wise the PDF file will
reference a smask that does not exist.

The _cairo_pattern_is_opaque() test is too strict for PDF as PDF can
draw EXTEND_NONE gradients with opaque color stops without requiring a
smask.
2010-10-15 15:26:39 +10:30