[Pixman] [PATCH 10/11] Delete the old src/dest_iter_init() functions
Søren Sandmann Pedersen
soren.sandmann at gmail.com
Wed May 22 06:45:19 PDT 2013
Now that we are using the new _pixman_implementation_iter_init(), the
old _src/_dest_iter_init() functions are no longer needed, so they can
be deleted, and the corresponding fields in pixman_implementation_t
can be removed.
---
pixman/pixman-fast-path.c | 38 -------------------------
pixman/pixman-general.c | 38 -------------------------
pixman/pixman-implementation.c | 64 ------------------------------------------
pixman/pixman-mmx.c | 25 -----------------
pixman/pixman-noop.c | 62 ++++------------------------------------
pixman/pixman-private.h | 28 ------------------
pixman/pixman-sse2.c | 25 -----------------
7 files changed, 6 insertions(+), 274 deletions(-)
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index d5f707f..9af26af 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -2292,50 +2292,12 @@ static const pixman_iter_info_t fast_iters[] =
{ PIXMAN_null },
};
-static pixman_bool_t
-fast_iter_init_common (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- const pixman_iter_info_t *info;
-
- for (info = fast_iters; info->format != PIXMAN_null; ++info)
- {
- if ((info->format == PIXMAN_any ||
- info->format == iter->image->common.extended_format_code) &&
- (info->image_flags & iter->image_flags) == info->image_flags &&
- (info->iter_flags & iter->iter_flags) == info->iter_flags)
- {
- iter->get_scanline = info->get_scanline;
- iter->write_back = info->write_back;
-
- if (info->initializer)
- info->initializer (iter, info);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static pixman_bool_t
-fast_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- return fast_iter_init_common (imp, iter);
-}
-
-static pixman_bool_t
-fast_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- return fast_iter_init_common (imp, iter);
-}
-
pixman_implementation_t *
_pixman_implementation_create_fast_path (pixman_implementation_t *fallback)
{
pixman_implementation_t *imp = _pixman_implementation_create (fallback, c_fast_paths);
imp->fill = fast_path_fill;
- imp->src_iter_init = fast_src_iter_init;
- imp->dest_iter_init = fast_dest_iter_init;
imp->iter_info = fast_iters;
return imp;
diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index c469a81..4da5da5 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -79,42 +79,6 @@ static const pixman_iter_info_t general_iters[] =
{ PIXMAN_null },
};
-static pixman_bool_t
-general_iter_init_common (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- const pixman_iter_info_t *info;
-
- for (info = general_iters; info->format != PIXMAN_null; ++info)
- {
- if ((info->format == PIXMAN_any ||
- info->format == iter->image->common.extended_format_code) &&
- (info->image_flags & iter->image_flags) == info->image_flags &&
- (info->iter_flags & iter->iter_flags) == info->iter_flags)
- {
- iter->get_scanline = info->get_scanline;
- iter->write_back = info->write_back;
-
- if (info->initializer)
- info->initializer (iter, info);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static pixman_bool_t
-general_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- return general_iter_init_common (imp, iter);
-}
-
-static pixman_bool_t
-general_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- return general_iter_init_common (imp, iter);
-}
-
typedef struct op_info_t op_info_t;
struct op_info_t
{
@@ -262,8 +226,6 @@ _pixman_implementation_create_general (void)
_pixman_setup_combiner_functions_32 (imp);
_pixman_setup_combiner_functions_float (imp);
- imp->src_iter_init = general_src_iter_init;
- imp->dest_iter_init = general_dest_iter_init;
imp->iter_info = general_iters;
return imp;
diff --git a/pixman/pixman-implementation.c b/pixman/pixman-implementation.c
index 4bdc836..160847a 100644
--- a/pixman/pixman-implementation.c
+++ b/pixman/pixman-implementation.c
@@ -349,70 +349,6 @@ _pixman_implementation_iter_init (pixman_implementation_t *imp,
}
pixman_bool_t
-_pixman_implementation_src_iter_init (pixman_implementation_t *imp,
- pixman_iter_t *iter,
- pixman_image_t *image,
- int x,
- int y,
- int width,
- int height,
- uint8_t *buffer,
- iter_flags_t iter_flags,
- uint32_t image_flags)
-{
- iter->image = image;
- iter->buffer = (uint32_t *)buffer;
- iter->x = x;
- iter->y = y;
- iter->width = width;
- iter->height = height;
- iter->iter_flags = iter_flags;
- iter->image_flags = image_flags;
-
- while (imp)
- {
- if (imp->src_iter_init && (*imp->src_iter_init) (imp, iter))
- return TRUE;
-
- imp = imp->fallback;
- }
-
- return FALSE;
-}
-
-pixman_bool_t
-_pixman_implementation_dest_iter_init (pixman_implementation_t *imp,
- pixman_iter_t *iter,
- pixman_image_t *image,
- int x,
- int y,
- int width,
- int height,
- uint8_t *buffer,
- iter_flags_t iter_flags,
- uint32_t image_flags)
-{
- iter->image = image;
- iter->buffer = (uint32_t *)buffer;
- iter->x = x;
- iter->y = y;
- iter->width = width;
- iter->height = height;
- iter->iter_flags = iter_flags;
- iter->image_flags = image_flags;
-
- while (imp)
- {
- if (imp->dest_iter_init && (*imp->dest_iter_init) (imp, iter))
- return TRUE;
-
- imp = imp->fallback;
- }
-
- return FALSE;
-}
-
-pixman_bool_t
_pixman_disabled (const char *name)
{
const char *env;
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index c3d81e0..861b856 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3951,30 +3951,6 @@ static const pixman_iter_info_t mmx_iters[] =
{ PIXMAN_null },
};
-static pixman_bool_t
-mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- const pixman_iter_info_t *info;
-
- for (info = mmx_iters; info->format != PIXMAN_null; ++info)
- {
- if ((info->format == PIXMAN_any ||
- info->format == iter->image->common.extended_format_code) &&
- (info->image_flags & iter->image_flags) == info->image_flags &&
- (info->iter_flags & iter->iter_flags) == info->iter_flags)
- {
- iter->get_scanline = info->get_scanline;
- iter->write_back = info->write_back;
-
- if (info->initializer)
- info->initializer (iter, info);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
static const pixman_fast_path_t mmx_fast_paths[] =
{
PIXMAN_STD_FAST_PATH (OVER, solid, a8, r5g6b5, mmx_composite_over_n_8_0565 ),
@@ -4104,7 +4080,6 @@ _pixman_implementation_create_mmx (pixman_implementation_t *fallback)
imp->fill = mmx_fill;
imp->iter_info = mmx_iters;
- imp->src_iter_init = mmx_src_iter_init;
return imp;
}
diff --git a/pixman/pixman-noop.c b/pixman/pixman-noop.c
index 68b3bc6..e598904 100644
--- a/pixman/pixman-noop.c
+++ b/pixman/pixman-noop.c
@@ -37,12 +37,6 @@ noop_composite (pixman_implementation_t *imp,
return;
}
-static void
-dest_write_back_direct (pixman_iter_t *iter)
-{
- iter->buffer += iter->image->bits.rowstride;
-}
-
static uint32_t *
noop_get_scanline (pixman_iter_t *iter, const uint32_t *mask)
{
@@ -53,12 +47,6 @@ noop_get_scanline (pixman_iter_t *iter, const uint32_t *mask)
return result;
}
-static uint32_t *
-get_scanline_null (pixman_iter_t *iter, const uint32_t *mask)
-{
- return NULL;
-}
-
static void
noop_init_solid_narrow (pixman_iter_t *iter,
const pixman_iter_info_t *info)
@@ -104,6 +92,12 @@ noop_init_direct_buffer (pixman_iter_t *iter, const pixman_iter_info_t *info)
image->bits.bits + iter->y * image->bits.rowstride + iter->x;
}
+static void
+dest_write_back_direct (pixman_iter_t *iter)
+{
+ iter->buffer += iter->image->bits.rowstride;
+}
+
static const pixman_iter_info_t noop_iters[] =
{
/* Source iters */
@@ -149,48 +143,6 @@ static const pixman_iter_info_t noop_iters[] =
{ PIXMAN_null },
};
-static pixman_bool_t
-noop_iter_init_common (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- const pixman_iter_info_t *info;
-
- if (!iter->image)
- {
- iter->get_scanline = get_scanline_null;
- return TRUE;
- }
-
- for (info = noop_iters; info->format != PIXMAN_null; ++info)
- {
- if ((info->format == PIXMAN_any ||
- info->format == iter->image->common.extended_format_code) &&
- (info->image_flags & iter->image_flags) == info->image_flags &&
- (info->iter_flags & iter->iter_flags) == info->iter_flags)
- {
- iter->get_scanline = info->get_scanline;
- iter->write_back = info->write_back;
-
- if (info->initializer)
- info->initializer (iter, info);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static pixman_bool_t
-noop_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- return noop_iter_init_common (imp, iter);
-}
-
-static pixman_bool_t
-noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- return noop_iter_init_common (imp, iter);
-}
-
static const pixman_fast_path_t noop_fast_paths[] =
{
{ PIXMAN_OP_DST, PIXMAN_any, 0, PIXMAN_any, 0, PIXMAN_any, 0, noop_composite },
@@ -203,8 +155,6 @@ _pixman_implementation_create_noop (pixman_implementation_t *fallback)
pixman_implementation_t *imp =
_pixman_implementation_create (fallback, noop_fast_paths);
- imp->src_iter_init = noop_src_iter_init;
- imp->dest_iter_init = noop_dest_iter_init;
imp->iter_info = noop_iters;
return imp;
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 6859c4a..aa0a842 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -474,8 +474,6 @@ typedef pixman_bool_t (*pixman_fill_func_t) (pixman_implementation_t *imp,
int width,
int height,
uint32_t filler);
-typedef pixman_bool_t (*pixman_iter_init_func_t) (pixman_implementation_t *imp,
- pixman_iter_t *iter);
void _pixman_setup_combiner_functions_32 (pixman_implementation_t *imp);
void _pixman_setup_combiner_functions_float (pixman_implementation_t *imp);
@@ -501,8 +499,6 @@ struct pixman_implementation_t
pixman_blt_func_t blt;
pixman_fill_func_t fill;
- pixman_iter_init_func_t src_iter_init;
- pixman_iter_init_func_t dest_iter_init;
pixman_combine_32_func_t combine_32[PIXMAN_N_OPERATORS];
pixman_combine_32_func_t combine_32_ca[PIXMAN_N_OPERATORS];
@@ -575,30 +571,6 @@ _pixman_implementation_iter_init (pixman_implementation_t *imp,
iter_flags_t flags,
uint32_t image_flags);
-pixman_bool_t
-_pixman_implementation_src_iter_init (pixman_implementation_t *imp,
- pixman_iter_t *iter,
- pixman_image_t *image,
- int x,
- int y,
- int width,
- int height,
- uint8_t *buffer,
- iter_flags_t flags,
- uint32_t image_flags);
-
-pixman_bool_t
-_pixman_implementation_dest_iter_init (pixman_implementation_t *imp,
- pixman_iter_t *iter,
- pixman_image_t *image,
- int x,
- int y,
- int width,
- int height,
- uint8_t *buffer,
- iter_flags_t flags,
- uint32_t image_flags);
-
/* Specific implementations */
pixman_implementation_t *
_pixman_implementation_create_general (void);
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 1f357e1..bc834b5 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -6369,30 +6369,6 @@ static const pixman_iter_info_t sse2_iters[] =
{ PIXMAN_null },
};
-static pixman_bool_t
-sse2_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
- const pixman_iter_info_t *info;
-
- for (info = sse2_iters; info->format != PIXMAN_null; ++info)
- {
- if ((info->format == PIXMAN_any ||
- info->format == iter->image->common.extended_format_code) &&
- (info->image_flags & iter->image_flags) == info->image_flags &&
- (info->iter_flags & iter->iter_flags) == info->iter_flags)
- {
- iter->get_scanline = info->get_scanline;
- iter->write_back = info->write_back;
-
- if (info->initializer)
- info->initializer (iter, info);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
__attribute__((__force_align_arg_pointer__))
#endif
@@ -6450,7 +6426,6 @@ _pixman_implementation_create_sse2 (pixman_implementation_t *fallback)
imp->fill = sse2_fill;
imp->iter_info = sse2_iters;
- imp->src_iter_init = sse2_src_iter_init;
return imp;
}
--
1.7.11.7
More information about the Pixman
mailing list