2 * Copyright © 2004 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Keith Packard makes no
11 * representations about the suitability of this software for any purpose. It
12 * is provided "as is" without express or implied warranty.
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
23 #ifdef HAVE_DIX_CONFIG_H
24 #include <dix-config.h>
27 #include "renderedge.h"
30 * Compute the smallest value no less than y which is on a
35 RenderSampleCeilY (xFixed y
, int n
)
37 return pixman_sample_ceil_y (y
, n
);
40 #define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
43 * Compute the largest value no greater than y which is on a
47 RenderSampleFloorY (xFixed y
, int n
)
49 return pixman_sample_floor_y (y
, n
);
53 * Step an edge by any amount (including negative values)
56 RenderEdgeStep (RenderEdge
*e
, int n
)
58 pixman_edge_step (e
, n
);
62 * Initialize one edge structure given the line endpoints and a
66 RenderEdgeInit (RenderEdge
*e
,
74 pixman_edge_init (e
, n
, y_start
, x_top
, y_top
, x_bot
, y_bot
);
78 * Initialize one edge structure given a line, starting y value
79 * and a pixel offset for the line
82 RenderLineFixedEdgeInit (RenderEdge
*e
,
89 pixman_line_fixed_edge_init (e
, n
, y
, (pixman_line_fixed_t
*)line
, x_off
, y_off
);