summaryrefslogtreecommitdiff
path: root/src/test-base-compositor-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-09-12 11:39:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-12 11:39:59 +0100
commit65a954d5bab9ab6fed15bd98b7018aca2fc50107 (patch)
treecbbe1f4a45ed05e3ab8a3ecde7780a5ba54e5fc1 /src/test-base-compositor-surface.c
parentaf9fbd176b145f042408ef5391eef2a51d7531f8 (diff)
downloadcairo-65a954d5bab9ab6fed15bd98b7018aca2fc50107.tar.gz
test-surfaces: compilation fixes
Update to the last minute changes in the traps compositor API. And so it begins. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/test-base-compositor-surface.c')
-rw-r--r--src/test-base-compositor-surface.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/test-base-compositor-surface.c b/src/test-base-compositor-surface.c
index 9d957a458..d2212c32c 100644
--- a/src/test-base-compositor-surface.c
+++ b/src/test-base-compositor-surface.c
@@ -628,92 +628,6 @@ typedef struct {
cairo_antialias_t antialias;
} composite_traps_info_t;
-#define CAIRO_FIXED_16_16_MIN _cairo_fixed_from_int (-32768)
-#define CAIRO_FIXED_16_16_MAX _cairo_fixed_from_int (32767)
-
-static cairo_bool_t
-line_exceeds_16_16 (const cairo_line_t *line)
-{
- return
- line->p1.x <= CAIRO_FIXED_16_16_MIN ||
- line->p1.x >= CAIRO_FIXED_16_16_MAX ||
-
- line->p2.x <= CAIRO_FIXED_16_16_MIN ||
- line->p2.x >= CAIRO_FIXED_16_16_MAX ||
-
- line->p1.y <= CAIRO_FIXED_16_16_MIN ||
- line->p1.y >= CAIRO_FIXED_16_16_MAX ||
-
- line->p2.y <= CAIRO_FIXED_16_16_MIN ||
- line->p2.y >= CAIRO_FIXED_16_16_MAX;
-}
-
-static void
-project_line_x_onto_16_16 (const cairo_line_t *line,
- cairo_fixed_t top,
- cairo_fixed_t bottom,
- pixman_line_fixed_t *out)
-{
- /* XXX use fixed-point arithmetic? */
- cairo_point_double_t p1, p2;
- double m;
-
- p1.x = _cairo_fixed_to_double (line->p1.x);
- p1.y = _cairo_fixed_to_double (line->p1.y);
-
- p2.x = _cairo_fixed_to_double (line->p2.x);
- p2.y = _cairo_fixed_to_double (line->p2.y);
-
- m = (p2.x - p1.x) / (p2.y - p1.y);
- out->p1.x = _cairo_fixed_16_16_from_double (p1.x + m * _cairo_fixed_to_double (top - line->p1.y));
- out->p2.x = _cairo_fixed_16_16_from_double (p1.x + m * _cairo_fixed_to_double (bottom - line->p1.y));
-}
-
-static void
-_pixman_image_add_traps (pixman_image_t *image,
- int dst_x, int dst_y,
- cairo_traps_t *traps)
-{
- cairo_trapezoid_t *t = traps->traps;
- int num_traps = traps->num_traps;
- while (num_traps--) {
- pixman_trapezoid_t trap;
-
- /* top/bottom will be clamped to surface bounds */
- trap.top = _cairo_fixed_to_16_16 (t->top);
- trap.bottom = _cairo_fixed_to_16_16 (t->bottom);
-
- /* However, all the other coordinates will have been left untouched so
- * as not to introduce numerical error. Recompute them if they
- * exceed the 16.16 limits.
- */
- if (unlikely (line_exceeds_16_16 (&t->left))) {
- project_line_x_onto_16_16 (&t->left, t->top, t->bottom, &trap.left);
- trap.left.p1.y = trap.top;
- trap.left.p2.y = trap.bottom;
- } else {
- trap.left.p1.x = _cairo_fixed_to_16_16 (t->left.p1.x);
- trap.left.p1.y = _cairo_fixed_to_16_16 (t->left.p1.y);
- trap.left.p2.x = _cairo_fixed_to_16_16 (t->left.p2.x);
- trap.left.p2.y = _cairo_fixed_to_16_16 (t->left.p2.y);
- }
-
- if (unlikely (line_exceeds_16_16 (&t->right))) {
- project_line_x_onto_16_16 (&t->right, t->top, t->bottom, &trap.right);
- trap.right.p1.y = trap.top;
- trap.right.p2.y = trap.bottom;
- } else {
- trap.right.p1.x = _cairo_fixed_to_16_16 (t->right.p1.x);
- trap.right.p1.y = _cairo_fixed_to_16_16 (t->right.p1.y);
- trap.right.p2.x = _cairo_fixed_to_16_16 (t->right.p2.x);
- trap.right.p2.y = _cairo_fixed_to_16_16 (t->right.p2.y);
- }
-
- pixman_rasterize_trapezoid (image, &trap, -dst_x, -dst_y);
- t++;
- }
-}
-
static cairo_int_status_t
composite_traps (cairo_image_surface_t *dst,
void *closure,