Commit graph

28 commits

Author SHA1 Message Date
Chris Wilson
5bc1b1f6aa stroke: Make the incremental trapezoid stroker optionally available again
Whilst it cannot handle self-intersecting strokes (which includes the
antialias region of neighbouring lines and joints), it is about 3x
faster to use than the more robust algorithm. As some backends delegate
the rendering, the quality may still be preserved and so they should be
responsible for choosing the appropriate method for generation of the
stroke geometry.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
d6a0567684 stroke: Remove redundant code for computing culling extents
Same code repeated!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 17:38:21 +01:00
Chris Wilson
e9c9e28cd1 Split cairo-box-privates into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:16:53 +01:00
Andrea Canciani
5c31566678 rectangle: Fix warning
In 545f3085.. the cairo_spline_add_point_func_t type was modified to
accept the tangent in the point, but cairo-rectangle.c was not updated
accordingly.

Fixes:

cairo-rectangle.c: In function '_cairo_box_add_curve_to':
cairo-rectangle.c:297:11: warning: passing argument 1 of
'_cairo_spline_bound' from incompatible pointer type
2011-10-26 15:10:59 +02:00
Chris Wilson
a69335a84e API: map-to-image and create-similar-image
A common requirement is the fast upload of pixel data. In order to
allocate the most appropriate image buffer, we need knowledge of the
destination. The most obvious example is that we could use a
shared-memory region for the image to avoid the transfer cost of
uploading the pixels to the X server. Similarly, gl, win32, quartz...

The other side of the equation is that for manual modification of a
remote surface, it would be more efficient if we can create a similar
image to reduce the transfer costs. This strategy is already followed
for the destination fallbacks and this merely exposes the same
capability for the application fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-26 14:55:58 +01:00
Chris Wilson
8ba8534d62 record: Store the untransformed operation extents along with the command
This allows us to actually clip out the geometry before we record it, as
suggested by allowing the user to supply an extents... But it will be
advantageous in later patches for reducing the amount of work we need to
perform to replay.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-26 08:02:59 +01: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
d21b4f3166 Add _cairo_rectangle_union
Implement _cairo_rectangle_union(), a function to compute a rectangle
containing two input rectangles.
2010-10-12 23:18:13 +02:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Chris Wilson
ae25f1c360 Alter definition of cairo_composite_rectangles_t
This is a more useful definition that is able to individually track the
rectangles that compose the composite operation. This will be used by
the specialist compositors as a means to perform the common extents
determination for an operation.
2010-01-22 23:01:51 +00:00
Chris Wilson
3f12d9ec5d [clip] Use geometric clipping for unaligned clips
For the simple cases where the clip is an unaligned box (or boxes), apply
the clip directly to the geometry and avoid having to use an intermediate
clip-mask.
2009-08-29 08:08:33 +01:00
Chris Wilson
813cbf13dd [path] Separate the approx. bounds into 3 distinct functions
Based on feedback from Jeff Muizelaar, there is a case for a very quick
and dirty extents approximation based solely on the curve control points
(for example when computing the clip intersect rectangle of a path) and
by moving the stroke extension into a core function we can clean up the
interface for all users, and centralise the logic of approximating the
stroke extents.
2008-12-18 14:55:20 +00:00
Chris Wilson
dea40e61ba [path] Return the fixed-point bounds of the path
When analysing the stroke extents, we need the original fixed-point
extents so that we do not incur an OBO when we round-to-integer a second
time. We also need a more accurate estimate than simply using the control
points of the curve, so pass in tolerance and decompose until someone
discovers a cheaper algorithm to determine the precise aligned bounding
box of a bezier curve.
2008-12-18 12:06:47 +00:00
Chris Wilson
bcb2724920 [path] Mark points as const during _cairo_path_fixed_interpret()
Use const to document the read-only nature of the arguments passed to the
callbacks.
2008-12-12 11:11:49 +00:00
M Joonas Pihlaja
4b227143b3 [cairo-spans] Introduce a type to track which pixels combine in a compositing op.
A cairo_composite_rectangles_t contains the coordinates of rectangular
windows into each of the source pattern, mask, clip and destination
surface containing the pixels that will combine in a compositing
operation.  The idea is to have a uniform way to represent all the
translations involved rather than overloading parameters like src_x/y,
dst_x/y, etc., sometimes with different incompatible meanings across
functions.
2008-12-06 14:04:35 +02:00
Chris Wilson
4b29988939 Review users of cairo_rectangle_int_t for incorrect unsigned promotion.
Adrian Johnson discovered cases where we mistakenly compared the result
of unsigned arithmetic where we need signed quantities. Look for similar
cases in the users of cairo_rectangle_int_t.
2008-10-30 16:19:38 +00:00
Chris Wilson
0e4156121f [rectangle] Fix unsigned promotion whilst computing intersect.
_cairo_rectangle_intersect() incorrectly allows unsigned promotion during
its arithmetic.
2008-10-30 16:19:26 +00:00
Behdad Esfahbod
2a3eec1731 [cairo-rectangle] Add new convenience functions for working with cairo_box_t
_cairo_box_from_doubles, _cairo_box_to_doubles, _cairo_box_from_rectangle.
2008-05-09 15:54:11 +02:00
Carl Worth
1489e66d25 Quiet a more subtle potentially-uninitialized warning
The compiler isn't clever enough to notice that these
variables are always initialized.
2008-04-01 14:49:03 -07:00
Vladimir Vukicevic
bf1f7f70b6 Do correct calculation of pen dimensions for stroke optimization 2008-02-06 13:07:13 -08:00
Vladimir Vukicevic
1d93e14876 Followup patch to dashed stroke optimization
Make sure that we don't test lines that start or end inside the box,
since our algorithm will find intersections on the wrong ends on the
line, and not count them.
2008-02-05 16:14:51 -08:00
Vladimir Vukicevic
4471e58c12 Optimize dashed strokes, part 2
Pass down the bounding box to the stroker, and avoid doing expensive
calculations for dash segments that are outside the box.
2008-02-05 15:04:28 -08:00
Behdad Esfahbod
0d898f2bad [doc] Make sure all type names in docs are prefixed by # 2008-01-28 20:49:44 -05:00
Vladimir Vukicevic
be3516335c [fixpt] Replace cairo_rectangle_int16_t with cairo_rectangle_int_t
Mostly s/cairo_rectangle_int16_t/cairo_rectangle_int_t/,
as well as definitions to pick cairo_rectangle_int_t.
2007-07-18 22:45:21 +02:00
Carl Worth
746f66c3fc Fix bogus cairo_rectangle_fixed_t to be cairo_rectangle_int16_t.
This rectangle has regular integer values, not fixed-point values.
So the old name was horribly wrong and misleading, (and yes I think
it was even I that had suggested it).
2006-06-06 16:54:03 -07:00
Carl Worth
00592e0757 Remove trailing whitespace from lines with a single brace.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e '/^[ \t]*[{}][ \t]*/ s/[ \t]+$//'

run on all *.[ch] files within cairo.
2006-06-06 15:38:58 -07:00
Carl Worth
28d47d332a Move rectangle functions to new cairo-rectangle.c 2006-06-05 14:25:22 -07:00