summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-12-10 15:18:48 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-01-03 15:59:42 -0500
commit07c398d74ff63a84c8aca23d4c89f6aeb3d048de (patch)
treef3a0d1bb0467b974fe5fda2df8210e00c4b926a3
parent2b3b9d8e755562232e9fffee29af752304c61c39 (diff)
Get rid of the classify methods.
They are not used anymore, and the linear gradient is now doing the optimization in a different way.
-rw-r--r--pixman/pixman-image.c14
-rw-r--r--pixman/pixman-linear-gradient.c28
-rw-r--r--pixman/pixman-private.h19
-rw-r--r--pixman/pixman-solid-fill.c12
4 files changed, 13 insertions, 60 deletions
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 74efa6f4..e276eacb 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -72,7 +72,6 @@ _pixman_image_allocate (void)
common->alpha_map = NULL;
common->component_alpha = FALSE;
common->ref_count = 1;
- common->classify = NULL;
common->property_changed = NULL;
common->client_clip = FALSE;
common->destroy_func = NULL;
@@ -83,19 +82,6 @@ _pixman_image_allocate (void)
return image;
}
-source_image_class_t
-_pixman_image_classify (pixman_image_t *image,
- int x,
- int y,
- int width,
- int height)
-{
- if (image->common.classify)
- return image->common.classify (image, x, y, width, height);
- else
- return SOURCE_IMAGE_CLASS_UNKNOWN;
-}
-
static void
image_property_changed (pixman_image_t *image)
{
diff --git a/pixman/pixman-linear-gradient.c b/pixman/pixman-linear-gradient.c
index 20be2492..b7786011 100644
--- a/pixman/pixman-linear-gradient.c
+++ b/pixman/pixman-linear-gradient.c
@@ -31,21 +31,21 @@
#include <stdlib.h>
#include "pixman-private.h"
-static source_image_class_t
-linear_gradient_classify (pixman_image_t *image,
- int x,
- int y,
- int width,
- int height)
+static pixman_bool_t
+linear_gradient_is_horizontal (pixman_image_t *image,
+ int x,
+ int y,
+ int width,
+ int height)
{
linear_gradient_t *linear = (linear_gradient_t *)image;
pixman_vector_t v;
pixman_fixed_32_32_t l;
pixman_fixed_48_16_t dx, dy;
double inc;
- source_image_class_t class;
+ pixman_bool_t result;
- class = SOURCE_IMAGE_CLASS_UNKNOWN;
+ result = FALSE;
if (image->common.transform)
{
@@ -54,7 +54,7 @@ linear_gradient_classify (pixman_image_t *image,
image->common.transform->matrix[2][1] != 0 ||
image->common.transform->matrix[2][2] == 0)
{
- return class;
+ return result;
}
v.vector[0] = image->common.transform->matrix[0][1];
@@ -74,7 +74,7 @@ linear_gradient_classify (pixman_image_t *image,
l = dx * dx + dy * dy;
if (l == 0)
- return class;
+ return result;
/*
* compute how much the input of the gradient walked changes
@@ -86,9 +86,9 @@ linear_gradient_classify (pixman_image_t *image,
/* check that casting to integer would result in 0 */
if (-1 < inc && inc < 1)
- class = SOURCE_IMAGE_CLASS_HORIZONTAL;
+ result = TRUE;
- return class;
+ return result;
}
static uint32_t *
@@ -243,8 +243,7 @@ _pixman_linear_gradient_iter_init (pixman_image_t *image,
uint8_t *buffer,
iter_flags_t flags)
{
- if (linear_gradient_classify (image, x, y, width, height) ==
- SOURCE_IMAGE_CLASS_HORIZONTAL)
+ if (linear_gradient_is_horizontal (image, x, y, width, height))
{
if (flags & ITER_NARROW)
linear_gradient_get_scanline_narrow (iter, NULL);
@@ -291,7 +290,6 @@ pixman_image_create_linear_gradient (pixman_point_fixed_t * p1,
linear->p2 = *p2;
image->type = LINEAR;
- image->common.classify = linear_gradient_classify;
return image;
}
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index d62f4cd8..8d3a6041 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -60,17 +60,6 @@ typedef enum
SOLID
} image_type_t;
-typedef enum
-{
- SOURCE_IMAGE_CLASS_UNKNOWN,
- SOURCE_IMAGE_CLASS_HORIZONTAL,
-} source_image_class_t;
-
-typedef source_image_class_t (*classify_func_t) (pixman_image_t *image,
- int x,
- int y,
- int width,
- int height);
typedef void (*property_changed_func_t) (pixman_image_t *image);
struct image_common
@@ -95,7 +84,6 @@ struct image_common
int alpha_origin_x;
int alpha_origin_y;
pixman_bool_t component_alpha;
- classify_func_t classify;
property_changed_func_t property_changed;
pixman_image_destroy_func_t destroy_func;
@@ -249,13 +237,6 @@ _pixman_conical_gradient_iter_init (pixman_image_t *image,
int x, int y, int width, int height,
uint8_t *buffer, iter_flags_t flags);
-source_image_class_t
-_pixman_image_classify (pixman_image_t *image,
- int x,
- int y,
- int width,
- int height);
-
pixman_image_t *
_pixman_image_allocate (void);
diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c
index f6aca594..9795fd9c 100644
--- a/pixman/pixman-solid-fill.c
+++ b/pixman/pixman-solid-fill.c
@@ -26,16 +26,6 @@
#endif
#include "pixman-private.h"
-static source_image_class_t
-solid_fill_classify (pixman_image_t *image,
- int x,
- int y,
- int width,
- int height)
-{
- return SOURCE_IMAGE_CLASS_HORIZONTAL;
-}
-
void
_pixman_solid_fill_iter_init (pixman_image_t *image,
pixman_iter_t *iter,
@@ -98,8 +88,6 @@ pixman_image_create_solid_fill (pixman_color_t *color)
img->solid.color_32 = color_to_uint32 (color);
img->solid.color_64 = color_to_uint64 (color);
- img->common.classify = solid_fill_classify;
-
return img;
}