summaryrefslogtreecommitdiff
path: root/liboil/ref
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2005-12-20 01:28:18 +0000
committerEric Anholt <anholt@FreeBSD.org>2005-12-20 01:28:18 +0000
commitcdd6b88eff544b6a3ed93796f981cbef36a51f2e (patch)
tree32579ddeb633bdc8dec5f5b3a71566cfa7a6f168 /liboil/ref
parent29dcaccf2f3a87c1131681612b878519a6a49ccd (diff)
downloadliboil-cdd6b88eff544b6a3ed93796f981cbef36a51f2e.tar.gz
Add a ref and mmx implementation of composite_add_u8_const_src, like
composite_add_argb_const_src. This may prove useful for trapezoid rasterization in cairo.
Diffstat (limited to 'liboil/ref')
-rw-r--r--liboil/ref/composite.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/liboil/ref/composite.c b/liboil/ref/composite.c
index ff2610d..c9df4cb 100644
--- a/liboil/ref/composite.c
+++ b/liboil/ref/composite.c
@@ -228,6 +228,17 @@ OIL_DEFINE_CLASS_FULL (composite_over_u8,
OIL_DEFINE_CLASS_FULL (composite_add_u8,
"uint8_t *i_n, uint8_t *s1_n, int n",
composite_test);
+/**
+ * oil_composite_add_u8_const_src:
+ * @i_n: DEST
+ * @s1_1: SRC
+ * @n: number of elements
+ *
+ * Performs the compositing operation DEST = SRC ADD DEST.
+ */
+OIL_DEFINE_CLASS_FULL (composite_add_u8_const_src,
+ "uint8_t *i_n, uint8_t *s1_1, int n",
+ composite_test);
static void
composite_in_argb_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
@@ -427,6 +438,18 @@ composite_add_u8_ref (uint8_t *dest, const uint8_t *src, int n)
OIL_DEFINE_IMPL_REF (composite_add_u8_ref, composite_add_u8);
static void
+composite_add_u8_const_src_ref (uint8_t *dest, const uint8_t *src1_1, int n)
+{
+ int i;
+
+ for(i=0;i<n;i++){
+ dest[i] = COMPOSITE_ADD(dest[i],src1_1[0]);
+ }
+
+}
+OIL_DEFINE_IMPL_REF (composite_add_u8_const_src_ref, composite_add_u8_const_src);
+
+static void
composite_over_u8_ref (uint8_t *dest, const uint8_t *src, int n)
{
int i;