summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2011-03-12 19:12:35 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-03-18 16:23:10 -0400
commit74d0f44b6d6d613d24541b849835da0464cc6fd0 (patch)
treeef24bd9fd7c0dfea6a22c2a7a9620a32c0e98dd0
parentbe4eaa0e4f79af38b7b89c5b09ca88d3a88d9396 (diff)
Fill out parts of iters in _pixman_implementation_{src,dest}_iter_init()
This makes _pixman_implementation_{src,dest}_iter_init() responsible for filling parts of the information in the iterators. Specifically, the information passed as arguments is stored in the iterator. Also add a height field to pixman_iter_t().
-rw-r--r--pixman/pixman-general.c6
-rw-r--r--pixman/pixman-implementation.c16
-rw-r--r--pixman/pixman-private.h11
-rw-r--r--pixman/pixman-sse2.c2
4 files changed, 24 insertions, 11 deletions
diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index 872fb7e9..1a0fa7c9 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -44,12 +44,6 @@ general_src_iter_init (pixman_implementation_t *imp,
int x, int y, int width, int height,
uint8_t *buffer, iter_flags_t flags)
{
- iter->image = image;
- iter->x = x;
- iter->y = y;
- iter->width = width;
- iter->buffer = (uint32_t *)buffer;
-
if (image->type == SOLID)
{
_pixman_solid_fill_iter_init (
diff --git a/pixman/pixman-implementation.c b/pixman/pixman-implementation.c
index 892767ea..bdd4543d 100644
--- a/pixman/pixman-implementation.c
+++ b/pixman/pixman-implementation.c
@@ -274,6 +274,14 @@ _pixman_implementation_src_iter_init (pixman_implementation_t *imp,
uint8_t *buffer,
iter_flags_t flags)
{
+ iter->image = image;
+ iter->buffer = (uint32_t *)buffer;
+ iter->x = x;
+ iter->y = y;
+ iter->width = width;
+ iter->height = height;
+ iter->flags = flags;
+
if (!image)
{
iter->get_scanline = get_scanline_null;
@@ -301,6 +309,14 @@ _pixman_implementation_dest_iter_init (pixman_implementation_t *imp,
uint8_t *buffer,
iter_flags_t flags)
{
+ iter->image = image;
+ iter->buffer = (uint32_t *)buffer;
+ iter->x = x;
+ iter->y = y;
+ iter->width = width;
+ iter->height = height;
+ iter->flags = flags;
+
(*imp->dest_iter_init) (
imp, iter, image, x, y, width, height, buffer, flags);
}
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 1473dc48..ea9545f4 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -212,14 +212,19 @@ typedef enum
struct pixman_iter_t
{
- pixman_iter_get_scanline_t get_scanline;
- pixman_iter_write_back_t write_back;
-
+ /* These are initialized by _pixman_implementation_{src,dest}_init */
pixman_image_t * image;
uint32_t * buffer;
int x, y;
int width;
+ int height;
+ iter_flags_t flags;
+
+ /* These function pointers are initialized by the implementation */
+ pixman_iter_get_scanline_t get_scanline;
+ pixman_iter_write_back_t write_back;
+ /* These fields are scratch data that implementations can use */
uint8_t * bits;
int stride;
};
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index d4a34e94..43a6bf2a 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -6004,8 +6004,6 @@ sse2_src_iter_init (pixman_implementation_t *imp,
iter->bits = b + s * y + x * PIXMAN_FORMAT_BPP (f->format) / 8;
iter->stride = s;
- iter->width = width;
- iter->buffer = (uint32_t *)buffer;
iter->get_scanline = f->get_scanline;
return;