[Pixman] [PATCH] pixman-combine.c.template: Formatting clean-ups
Søren Sandmann
sandmann at cs.au.dk
Fri Sep 21 14:12:00 PDT 2012
From: Søren Sandmann Pedersen <ssp at redhat.com>
Various formatting fixes, and removal of some obsolete comments about
strength reduction of operators.
---
pixman/pixman-combine.c.template | 38 +++++++-------------------------------
1 files changed, 7 insertions(+), 31 deletions(-)
diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template
index 50d2b0a..f405312 100644
--- a/pixman/pixman-combine.c.template
+++ b/pixman/pixman-combine.c.template
@@ -6,10 +6,9 @@
#include <string.h>
#include "pixman-private.h"
-
#include "pixman-combine.h"
-/*** per channel helper functions ***/
+/* component alpha helper functions */
static void
combine_mask_ca (comp4_t *src, comp4_t *mask)
@@ -91,15 +90,11 @@ combine_mask_alpha_ca (const comp4_t *src, comp4_t *mask)
/*
* There are two ways of handling alpha -- either as a single unified value or
* a separate value for each component, hence each macro must have two
- * versions. The unified alpha version has a 'U' at the end of the name,
- * the component version has a 'C'. Similarly, functions which deal with
+ * versions. The unified alpha version has a 'u' at the end of the name,
+ * the component version has a 'ca'. Similarly, functions which deal with
* this difference will have two versions using the same convention.
*/
-/*
- * All of the composing functions
- */
-
static force_inline comp4_t
combine_mask (const comp4_t *src, const comp4_t *mask, int i)
{
@@ -154,7 +149,9 @@ combine_src_u (pixman_implementation_t *imp,
int i;
if (!mask)
+ {
memcpy (dest, src, width * sizeof (comp4_t));
+ }
else
{
for (i = 0; i < width; ++i)
@@ -166,7 +163,6 @@ combine_src_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, call combine_src_u */
static void
combine_over_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -188,7 +184,6 @@ combine_over_u (pixman_implementation_t *imp,
}
}
-/* if the Dst is opaque, this is a noop */
static void
combine_over_reverse_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -209,7 +204,6 @@ combine_over_reverse_u (pixman_implementation_t *imp,
}
}
-/* if the Dst is opaque, call combine_src_u */
static void
combine_in_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -229,7 +223,6 @@ combine_in_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, this is a noop */
static void
combine_in_reverse_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -250,7 +243,6 @@ combine_in_reverse_u (pixman_implementation_t *imp,
}
}
-/* if the Dst is opaque, call combine_clear */
static void
combine_out_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -270,7 +262,6 @@ combine_out_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, call combine_clear */
static void
combine_out_reverse_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -291,9 +282,6 @@ combine_out_reverse_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, call combine_in_u */
-/* if the Dst is opaque, call combine_over_u */
-/* if both the Src and Dst are opaque, call combine_src_u */
static void
combine_atop_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -316,9 +304,6 @@ combine_atop_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, call combine_over_reverse_u */
-/* if the Dst is opaque, call combine_in_reverse_u */
-/* if both the Src and Dst are opaque, call combine_dst_u */
static void
combine_atop_reverse_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -341,9 +326,6 @@ combine_atop_reverse_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, call combine_over_u */
-/* if the Dst is opaque, call combine_over_reverse_u */
-/* if both the Src and Dst are opaque, call combine_clear */
static void
combine_xor_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -385,9 +367,6 @@ combine_add_u (pixman_implementation_t *imp,
}
}
-/* if the Src is opaque, call combine_add_u */
-/* if the Dst is opaque, call combine_add_u */
-/* if both the Src and Dst are opaque, call combine_add_u */
static void
combine_saturate_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -444,7 +423,6 @@ combine_saturate_u (pixman_implementation_t *imp,
* Multiply
* B(Dca, ad, Sca, as) = Dca.Sca
*/
-
static void
combine_multiply_u (pixman_implementation_t *imp,
pixman_op_t op,
@@ -1579,9 +1557,8 @@ combine_conjoint_xor_u (pixman_implementation_t *imp,
combine_conjoint_general_u (dest, src, mask, width, COMBINE_XOR);
}
-/************************************************************************/
-/*********************** Per Channel functions **************************/
-/************************************************************************/
+
+/* Component alpha combiners */
static void
combine_clear_ca (pixman_implementation_t *imp,
@@ -2458,4 +2435,3 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
imp->combine_width_ca[PIXMAN_OP_HSL_COLOR] = combine_dst;
imp->combine_width_ca[PIXMAN_OP_HSL_LUMINOSITY] = combine_dst;
}
-
--
1.7.4
More information about the Pixman
mailing list