summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-01-28 17:50:13 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-02-16 18:47:10 -0500
commit05cb25816c83a694ae5cb814a16c24bcd2002120 (patch)
tree6e6a3643ff1aae185e32d6cd6fc7dcae44ca76e7
parent1af2c51d609f98a81094d6f5814312a072bd1c03 (diff)
get
-rw-r--r--trace/pixman-replay.c66
1 files changed, 65 insertions, 1 deletions
diff --git a/trace/pixman-replay.c b/trace/pixman-replay.c
index 6bc46076..fb435b9b 100644
--- a/trace/pixman-replay.c
+++ b/trace/pixman-replay.c
@@ -283,6 +283,33 @@ get_traps (uint32_t **buffer, int *n_traps, pixman_trap_t **traps)
get_trap (buffer, &((*traps)[i]));
}
+static void
+get_line (uint32_t **buffer, pixman_line_fixed_t *line)
+{
+ get_point (buffer, &line->p1);
+ get_point (buffer, &line->p2);
+}
+
+static void
+get_trapezoid (uint32_t **buffer, pixman_trapezoid_t *trap)
+{
+ get_fixed (buffer, &trap->top);
+ get_fixed (buffer, &trap->bottom);
+ get_line (buffer, &trap->left);
+ get_line (buffer, &trap->right);
+}
+
+static void
+get_trapezoids (uint32_t **buffer, int *n_traps, pixman_trapezoid_t **traps)
+{
+ int i;
+
+ *n_traps = read_int (buffer);
+ *traps = realloc (*traps, *n_traps * sizeof (pixman_trapezoid_t));
+ for (i = 0; i < *n_traps; ++i)
+ get_trapezoid (buffer, &((*traps)[i]));
+}
+
typedef struct
{
pixman_image_t * image;
@@ -377,6 +404,8 @@ pixman_replay (const char *filename)
int src_x, src_y, mask_x, mask_y, dst_x, dst_y;
int n_traps;
pixman_trap_t *traps = NULL;
+ pixman_trapezoid_t *trapezoids = NULL;
+ pixman_trapezoid_t trapezoid;
switch (op)
{
@@ -565,7 +594,6 @@ pixman_replay (const char *filename)
break;
case ADD_TRAPS:
- get_operator (&buffer, &operator);
get_id (&buffer, &id);
get_int (&buffer, &x_off);
get_int (&buffer, &y_off);
@@ -574,9 +602,45 @@ pixman_replay (const char *filename)
break;
case ADD_TRAPEZOIDS:
+ get_id (&buffer, &id);
+ get_int (&buffer, &x_off);
+ get_int (&buffer, &y_off);
+ get_trapezoids (&buffer, &n_traps, &trapezoids);
+ pixman_add_trapezoids (find_image (id), x_off, y_off, n_traps, trapezoids);
case RASTERIZE_TRAPEZOID:
+ get_id (&buffer, &id);
+ get_trapezoid (&buffer, &trapezoid);
+ get_int (&buffer, &x_off);
+ get_int (&buffer, &y_off);
+ pixman_rasterize_trapezoid (
+ find_image (id), &trapezoid, x_off, y_off);
+ break;
+
case COMPOSITE_TRAPEZOIDS:
+ get_operator (buffer, &operator);
+ get_id (buffer, &src_id);
+ get_id (buffer, &dst_id);
+ get_format (buffer, &format);
+ get_int (buffer, &src_x);
+ get_int (buffer, &src_y);
+ get_int (buffer, &dst_x);
+ get_int (buffer, &dst_y);
+ get_trapezoids (buffer, &trapezoids);
+ pixman_composite_trapeoids (
+ break;
+
case COMPOSITE_TRIANGLES:
+ get_operator (buffer, &operator);
+ get_id (buffer, &src_id);
+ get_id (buffer, &dst_id);
+ get_format (buffer, &format);
+ get_int (buffer, &src_x);
+ get_int (buffer, &src_y);
+ get_int (buffer, &dst_x);
+ get_int (buffer, &dst_y);
+ get_triangles (buffer, &triangles);
+ pixman_composite_triangles (
+ op, find_image (src_id),
case ADD_TRIANGLES:
break;
}