[Pixman] [PATCH] Add no-op combiners for DST and the CA versions of the HSL operators.

Søren Sandmann sandmann at daimi.au.dk
Tue Oct 5 23:45:24 PDT 2010


From: Søren Sandmann Pedersen <ssp at redhat.com>

We already exit early for DST, but for the HSL operators with
component alpha, we crash at the moment. Fix that by adding a dummy
combine_dst() function.
---
 pixman/pixman-combine.c.template |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template
index 0d3b95d..56dfb43 100644
--- a/pixman/pixman-combine.c.template
+++ b/pixman/pixman-combine.c.template
@@ -133,6 +133,17 @@ combine_clear (pixman_implementation_t *imp,
 }
 
 static void
+combine_dst (pixman_implementation_t *imp,
+	     pixman_op_t	      op,
+	     comp4_t *		      dest,
+	     const comp4_t *	      src,
+	     const comp4_t *          mask,
+	     int		      width)
+{
+    return;
+}
+
+static void
 combine_src_u (pixman_implementation_t *imp,
                pixman_op_t              op,
                comp4_t *                dest,
@@ -2310,7 +2321,7 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     /* Unified alpha */
     imp->combine_width[PIXMAN_OP_CLEAR] = combine_clear;
     imp->combine_width[PIXMAN_OP_SRC] = combine_src_u;
-    /* dest */
+    imp->combine_width[PIXMAN_OP_DST] = combine_dst;
     imp->combine_width[PIXMAN_OP_OVER] = combine_over_u;
     imp->combine_width[PIXMAN_OP_OVER_REVERSE] = combine_over_reverse_u;
     imp->combine_width[PIXMAN_OP_IN] = combine_in_u;
@@ -2326,7 +2337,7 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     /* Disjoint, unified */
     imp->combine_width[PIXMAN_OP_DISJOINT_CLEAR] = combine_clear;
     imp->combine_width[PIXMAN_OP_DISJOINT_SRC] = combine_src_u;
-    /* dest */
+    imp->combine_width[PIXMAN_OP_DISJOINT_DST] = combine_dst;
     imp->combine_width[PIXMAN_OP_DISJOINT_OVER] = combine_disjoint_over_u;
     imp->combine_width[PIXMAN_OP_DISJOINT_OVER_REVERSE] = combine_saturate_u;
     imp->combine_width[PIXMAN_OP_DISJOINT_IN] = combine_disjoint_in_u;
@@ -2340,7 +2351,7 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     /* Conjoint, unified */
     imp->combine_width[PIXMAN_OP_CONJOINT_CLEAR] = combine_clear;
     imp->combine_width[PIXMAN_OP_CONJOINT_SRC] = combine_src_u;
-    /* dest */
+    imp->combine_width[PIXMAN_OP_CONJOINT_DST] = combine_dst;
     imp->combine_width[PIXMAN_OP_CONJOINT_OVER] = combine_conjoint_over_u;
     imp->combine_width[PIXMAN_OP_CONJOINT_OVER_REVERSE] = combine_conjoint_over_reverse_u;
     imp->combine_width[PIXMAN_OP_CONJOINT_IN] = combine_conjoint_in_u;
@@ -2386,7 +2397,7 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     /* Disjoint CA */
     imp->combine_width_ca[PIXMAN_OP_DISJOINT_CLEAR] = combine_clear_ca;
     imp->combine_width_ca[PIXMAN_OP_DISJOINT_SRC] = combine_src_ca;
-    /* dest */
+    imp->combine_width_ca[PIXMAN_OP_DISJOINT_DST] = combine_dst;
     imp->combine_width_ca[PIXMAN_OP_DISJOINT_OVER] = combine_disjoint_over_ca;
     imp->combine_width_ca[PIXMAN_OP_DISJOINT_OVER_REVERSE] = combine_saturate_ca;
     imp->combine_width_ca[PIXMAN_OP_DISJOINT_IN] = combine_disjoint_in_ca;
@@ -2400,7 +2411,7 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     /* Conjoint CA */
     imp->combine_width_ca[PIXMAN_OP_CONJOINT_CLEAR] = combine_clear_ca;
     imp->combine_width_ca[PIXMAN_OP_CONJOINT_SRC] = combine_src_ca;
-    /* dest */
+    imp->combine_width_ca[PIXMAN_OP_CONJOINT_DST] = combine_dst;
     imp->combine_width_ca[PIXMAN_OP_CONJOINT_OVER] = combine_conjoint_over_ca;
     imp->combine_width_ca[PIXMAN_OP_CONJOINT_OVER_REVERSE] = combine_conjoint_over_reverse_ca;
     imp->combine_width_ca[PIXMAN_OP_CONJOINT_IN] = combine_conjoint_in_ca;
@@ -2423,10 +2434,10 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     imp->combine_width_ca[PIXMAN_OP_DIFFERENCE] = combine_difference_ca;
     imp->combine_width_ca[PIXMAN_OP_EXCLUSION] = combine_exclusion_ca;
 
-    /* It is not clear that these make sense, so leave them out for now */
-    imp->combine_width_ca[PIXMAN_OP_HSL_HUE] = NULL;
-    imp->combine_width_ca[PIXMAN_OP_HSL_SATURATION] = NULL;
-    imp->combine_width_ca[PIXMAN_OP_HSL_COLOR] = NULL;
-    imp->combine_width_ca[PIXMAN_OP_HSL_LUMINOSITY] = NULL;
+    /* It is not clear that these make sense, so make them noops for now */
+    imp->combine_width_ca[PIXMAN_OP_HSL_HUE] = combine_dst;
+    imp->combine_width_ca[PIXMAN_OP_HSL_SATURATION] = combine_dst;
+    imp->combine_width_ca[PIXMAN_OP_HSL_COLOR] = combine_dst;
+    imp->combine_width_ca[PIXMAN_OP_HSL_LUMINOSITY] = combine_dst;
 }
 
-- 
1.7.1.1



More information about the Pixman mailing list