pixman: Changes to 'upstream-experimental'
Makefile.am | 2
RELEASING | 28
TODO | 19
configure.ac | 86
pixman/Makefile.am | 16
pixman/Makefile.win32 | 85
pixman/pixman-image.c | 4
pixman/pixman-mmx.c | 27
pixman/pixman-pict.c | 29
pixman/pixman-private.h | 3
pixman/pixman-sse.c | 4653 -------------------------------------------
pixman/pixman-sse.h | 358 ---
pixman/pixman-sse2.c | 4726 ++++++++++++++++++++++++++++++++++++++++++++
pixman/pixman-sse2.h | 358 +++
pixman/pixman-transformed.c | 3
pixman/pixman-utils.c | 2
pixman/pixman.h | 4
test/Makefile.am | 4
test/clip-test.c | 159 +
19 files changed, 5407 insertions(+), 5159 deletions(-)
New commits:
commit 412b0d5cbc2c0a5200649cbb0b5e26f8b874437d
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed Sep 17 14:03:23 2008 -0400
Pre-release version bump
diff --git a/configure.ac b/configure.ac
index 3821dcc..eb8879c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,8 +53,8 @@ AC_PREREQ([2.57])
#
m4_define([pixman_major], 0)
-m4_define([pixman_minor], 11)
-m4_define([pixman_micro], 10)
+m4_define([pixman_minor], 12)
+m4_define([pixman_micro], 0)
m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
commit 3f5d6f90b753175a888f36a93d1e79fdc80d95de
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed Sep 17 09:50:57 2008 -0400
Don't include stdio.h
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 0c671ed..0f36436 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -1,4 +1,3 @@
-#include <stdio.h>
/*
* Copyright © 2008 Rodrigo Kumpera
* Copyright © 2008 André Tupinambá
commit eba402092082bf48072671e04e224589af872acd
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sun Sep 14 14:58:00 2008 -0400
[sse2] Fix rounding bug in conversion from 565 to 8888
When converting from 565 to 8888, replicate the topmost bits instead
of appending zeros.
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index cc08189..0c671ed 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
/*
* Copyright © 2008 Rodrigo Kumpera
* Copyright © 2008 André Tupinambá
@@ -73,6 +74,9 @@ static __m128i MaskRed;
static __m128i MaskGreen;
static __m128i MaskBlue;
+static __m128i Mask565FixRB;
+static __m128i Mask565FixG;
+
/* -------------------------------------------------------------------------------------------------
* SSE2 Inlines
*/
@@ -89,26 +93,37 @@ unpack_128_2x128 (__m128i data, __m128i* dataLo, __m128i* dataHi)
*dataHi = _mm_unpackhi_epi8 (data, _mm_setzero_si128 ());
}
+static inline __m128i
+unpack565to8888 (__m128i lo)
+{
+ __m128i r, g, b, rb, t;
+
+ r = _mm_and_si128 (_mm_slli_epi32 (lo, 8), MaskRed);
+ g = _mm_and_si128 (_mm_slli_epi32 (lo, 5), MaskGreen);
+ b = _mm_and_si128 (_mm_slli_epi32 (lo, 3), MaskBlue);
+
+ rb = _mm_or_si128 (r, b);
+ t = _mm_and_si128 (rb, Mask565FixRB);
+ t = _mm_srli_epi32 (t, 5);
+ rb = _mm_or_si128 (rb, t);
+
+ t = _mm_and_si128 (g, Mask565FixG);
+ t = _mm_srli_epi32 (t, 6);
+ g = _mm_or_si128 (g, t);
+
+ return _mm_or_si128 (rb, g);
+}
+
static inline void
unpack565_128_4x128 (__m128i data, __m128i* data0, __m128i* data1, __m128i* data2, __m128i* data3)
{
__m128i lo, hi;
- __m128i r, g, b;
lo = _mm_unpacklo_epi16 (data, _mm_setzero_si128 ());
hi = _mm_unpackhi_epi16 (data, _mm_setzero_si128 ());
- r = _mm_and_si128 (_mm_slli_epi32 (lo, 8), MaskRed);
- g = _mm_and_si128 (_mm_slli_epi32 (lo, 5), MaskGreen);
- b = _mm_and_si128 (_mm_slli_epi32 (lo, 3), MaskBlue);
-
- lo = _mm_or_si128 (_mm_or_si128 (r, g), b);
-
- r = _mm_and_si128 (_mm_slli_epi32 (hi, 8), MaskRed);
- g = _mm_and_si128 (_mm_slli_epi32 (hi, 5), MaskGreen);
- b = _mm_and_si128 (_mm_slli_epi32 (hi, 3), MaskBlue);
-
- hi = _mm_or_si128 (_mm_or_si128 (r, g), b);
+ lo = unpack565to8888 (lo);
+ hi = unpack565to8888 (hi);
unpack_128_2x128 (lo, data0, data1);
unpack_128_2x128 (hi, data2, data3);
@@ -2297,7 +2312,8 @@ fbComposeSetupSSE2(void)
MaskRed = createMask_2x32_128 (0x00f80000, 0x00f80000);
MaskGreen = createMask_2x32_128 (0x0000fc00, 0x0000fc00);
MaskBlue = createMask_2x32_128 (0x000000f8, 0x000000f8);
-
+ Mask565FixRB = createMask_2x32_128 (0x00e000e0, 0x00e000e0);
+ Mask565FixG = createMask_2x32_128 (0x0000c000, 0x0000c000);
Mask0080 = createMask_16_128 (0x0080);
Mask00ff = createMask_16_128 (0x00ff);
Mask0101 = createMask_16_128 (0x0101);
@@ -2484,6 +2500,7 @@ fbCompositeSolid_nx0565sse2 (pixman_op_t op,
while (w && (unsigned long)dst & 15)
{
d = *dst;
+
*dst++ = pack565_32_16 (pack_1x64_32 (over_1x64 (_mm_movepi64_pi64 (xmmSrc),
_mm_movepi64_pi64 (xmmAlpha),
expand565_16_1x64 (d))));
@@ -2498,15 +2515,14 @@ fbCompositeSolid_nx0565sse2 (pixman_op_t op,
/* fill cache line with next memory */
cachePrefetchNext ((__m128i*)dst);
- xmmDst = load128Aligned ((__m128i*)dst);
-
- unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
-
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+
over_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmDst0, &xmmDst1);
over_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmDst2, &xmmDst3);
xmmDst = pack565_4x128_128 (&xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
-
save128Aligned ((__m128i*)dst, xmmDst);
dst += 8;
commit 6f00d98f87c019849c611d27e9593c5eecfef4c2
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Tue Sep 9 10:49:56 2008 -0400
Fix for bug 17477.
over_2x128 was changing the alphaLo and alphaHi arguments, causing
stripes.
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 8a3e4b5..cc08189 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -244,9 +244,11 @@ invertColors_2x128 (__m128i dataLo, __m128i dataHi, __m128i* invLo, __m128i* inv
static inline void
over_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaLo, __m128i* alphaHi, __m128i* dstLo, __m128i* dstHi)
{
- negate_2x128 (*alphaLo, *alphaHi, alphaLo, alphaHi);
+ __m128i t1, t2;
- pixMultiply_2x128 (dstLo, dstHi, alphaLo, alphaHi, dstLo, dstHi);
+ negate_2x128 (*alphaLo, *alphaHi, &t1, &t2);
+
+ pixMultiply_2x128 (dstLo, dstHi, &t1, &t2, dstLo, dstHi);
*dstLo = _mm_adds_epu8 (*srcLo, *dstLo);
*dstHi = _mm_adds_epu8 (*srcHi, *dstHi);
commit bf76505cc6cc5e54c25eb145748e9e364fb367e9
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sun Sep 7 00:40:09 2008 -0400
Update TODO
diff --git a/TODO b/TODO
index 9468021..47b9bc9 100644
--- a/TODO
+++ b/TODO
@@ -44,6 +44,11 @@
- Possibly look into inlining the fetch functions
+ - There is a bug with source clipping demonstrated by clip-test in the
+ test directory. If we interprete source clipping as given in
+ destination coordinates, which is probably the only sane choice,
+ then the result should have two red bars down the sides.
+
- Test suite
- Add a general way of dealing with architecture specific
diff --git a/pixman/pixman-transformed.c b/pixman/pixman-transformed.c
index 8dba26c..5ad92ae 100644
--- a/pixman/pixman-transformed.c
+++ b/pixman/pixman-transformed.c
@@ -593,7 +593,7 @@ ACCESS(fbFetchTransformed)(bits_image_t * pict, int x, int y, int width,
/* This allows filtering code to pretend that pixels are located at integer coordinates */
adjust (&v, &unit, -(pixman_fixed_1 / 2));
-
+
if (pict->common.filter == PIXMAN_FILTER_NEAREST || pict->common.filter == PIXMAN_FILTER_FAST)
{
/* Round down to closest integer, ensuring that 0.5 rounds to 0, not 1 */
@@ -602,7 +602,6 @@ ACCESS(fbFetchTransformed)(bits_image_t * pict, int x, int y, int width,
if (pict->common.repeat == PIXMAN_REPEAT_NORMAL)
{
fbFetchTransformed_Nearest_Normal(pict, width, buffer, mask, maskBits, affine, v, unit);
-
}
else if (pict->common.repeat == PIXMAN_REPEAT_PAD)
{
commit da18a5675b3107c9bf99e228d85619d247fa19a6
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sun Sep 7 00:13:10 2008 -0400
Extend clip-test to demonstrate a bug in source clipping
diff --git a/test/clip-test.c b/test/clip-test.c
index a52181f..457e97a 100644
--- a/test/clip-test.c
+++ b/test/clip-test.c
@@ -50,13 +50,13 @@ on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
}
static void
-show_window (uint32_t *bits, int w, int h, int stride)
+show_window (pixman_image_t *img, int w, int h, int stride)
{
GdkPixbuf *pixbuf;
GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- pixbuf = pixbuf_from_argb32 (bits, w, h, stride);
+ pixbuf = pixbuf_from_argb32 (pixman_image_get_data (img), w, h, stride);
g_signal_connect (window, "expose_event", G_CALLBACK (on_expose), pixbuf);
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
@@ -66,16 +66,29 @@ show_window (uint32_t *bits, int w, int h, int stride)
gtk_main ();
}
-int
-main (int argc, char **argv)
-{
#define WIDTH 200
#define HEIGHT 200
- uint32_t *src = malloc (WIDTH * HEIGHT * 4);
- pixman_image_t *gradient_img;
- pixman_image_t *src_img;
+static pixman_image_t *
+create_solid_bits (uint32_t pixel)
+{
+ uint32_t *pixels = malloc (WIDTH * HEIGHT * 4);
int i;
+
+ for (i = 0; i < WIDTH * HEIGHT; ++i)
+ pixels[i] = pixel;
+
+ return pixman_image_create_bits (PIXMAN_a8r8g8b8,
+ WIDTH, HEIGHT,
+ pixels,
+ WIDTH * 4);
+}
+
+int
+main (int argc, char **argv)
+{
+ pixman_image_t *gradient_img;
+ pixman_image_t *src_img, *dst_img;
pixman_gradient_stop_t stops[2] =
{
{ pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } },
@@ -88,16 +101,17 @@ main (int argc, char **argv)
pixman_point_fixed_t c_outer;
pixman_fixed_t r_inner;
pixman_fixed_t r_outer;
+ pixman_region32_t clip_region;
+ pixman_transform_t trans = {
+ { { pixman_double_to_fixed (1.3), pixman_double_to_fixed (0), pixman_double_to_fixed (-0.5), },
+ { pixman_double_to_fixed (0), pixman_double_to_fixed (1), pixman_double_to_fixed (-0.5), },
+ { pixman_double_to_fixed (0), pixman_double_to_fixed (0), pixman_double_to_fixed (1.0) }
+ }
+ };
gtk_init (&argc, &argv);
- for (i = 0; i < WIDTH * HEIGHT; ++i)
- src[i] = 0xFF0000ff; /* pale blue */
-
- src_img = pixman_image_create_bits (PIXMAN_a8r8g8b8,
- WIDTH, HEIGHT,
- src,
- WIDTH * 4);
+ src_img = create_solid_bits (0xff0000ff);
c_inner.x = pixman_double_to_fixed (100.0);
c_inner.y = pixman_double_to_fixed (100.0);
@@ -109,25 +123,37 @@ main (int argc, char **argv)
gradient_img = pixman_image_create_radial_gradient (&c_inner, &c_outer,
r_inner, r_outer,
stops, 2);
-
+
#if 0
gradient_img = pixman_image_create_linear_gradient (&p1, &p2,
stops, 2);
#endif
-
+
pixman_image_composite (PIXMAN_OP_OVER, gradient_img, NULL, src_img,
0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+ pixman_region32_init_rect (&clip_region, 50, 0, 100, 200);
+ pixman_image_set_clip_region32 (src_img, &clip_region);
+ pixman_image_set_source_clipping (src_img, TRUE);
+ pixman_image_set_transform (src_img, &trans);
+ pixman_image_set_repeat (src_img, PIXMAN_REPEAT_NORMAL);
+
+ dst_img = create_solid_bits (0xffff0000);
+ pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dst_img,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+
+#if 0
printf ("0, 0: %x\n", src[0]);
printf ("10, 10: %x\n", src[10 * 10 + 10]);
printf ("w, h: %x\n", src[(HEIGHT - 1) * 100 + (WIDTH - 1)]);
+#endif
- show_window (src, WIDTH, HEIGHT, WIDTH);
+ show_window (dst_img, WIDTH, HEIGHT, WIDTH);
pixman_image_unref (gradient_img);
pixman_image_unref (src_img);
- free (src);
return 0;
}
commit 00f3d6ef22b5a062323208fd540a17ca65dca42b
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sat Sep 6 23:49:25 2008 -0400
Fix bug in pixman_image_is_opaque()
Non-repeating gradient images would be reported as opaque. Also add
new test program to test source clipping.
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 487a672..e80c479 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -818,6 +818,10 @@ pixman_image_is_opaque(pixman_image_t *image)
if (image->common.transform)
return FALSE;
+
+ /* Gradients do not necessarily cover the entire compositing area */
+ if (image->type == LINEAR || image->type == CONICAL || image->type == RADIAL)
+ return FALSE;
}
return TRUE;
diff --git a/test/Makefile.am b/test/Makefile.am
index ced0579..33e2200 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,6 @@
if HAVE_GTK
-TESTPROGRAMS = \
+TESTPROGRAMS = \
+ clip-test \
composite-test \
gradient-test \
region-test \
@@ -13,5 +14,6 @@ composite_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
gradient_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
fetch_test_LDADD = $(top_builddir)/pixman/libpixman-1.la
region_test_LDADD = $(top_builddir)/pixman/libpixman-1.la
+clip_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
endif
diff --git a/test/clip-test.c b/test/clip-test.c
new file mode 100644
index 0000000..a52181f
--- /dev/null
+++ b/test/clip-test.c
@@ -0,0 +1,133 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <gtk/gtk.h>
+#include "pixman.h"
+
+GdkPixbuf *
+pixbuf_from_argb32 (uint32_t *bits,
+ int width,
+ int height,
+ int stride)
+{
+ GdkPixbuf *pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE,
+ 8, width, height);
+ int p_stride = gdk_pixbuf_get_rowstride (pixbuf);
+ guint32 *p_bits = (guint32 *)gdk_pixbuf_get_pixels (pixbuf);
+ int w, h;
+
+ for (h = 0; h < height; ++h)
+ {
+ for (w = 0; w < width; ++w)
+ {
+ uint32_t argb = bits[h * stride + w];
+ guint32 abgr;
+
+ abgr = (argb & 0xff000000) |
+ (argb & 0xff) << 16 |
+ (argb & 0x00ff00) |
+ (argb & 0xff0000) >> 16;
+
+ p_bits[h * (p_stride / 4) + w] = abgr;
+ }
+ }
+
+ return pixbuf;
+}
+
+static gboolean
+on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
+{
+ GdkPixbuf *pixbuf = data;
+
+ gdk_draw_pixbuf (widget->window, NULL,
+ pixbuf, 0, 0, 0, 0,
+ gdk_pixbuf_get_width (pixbuf),
+ gdk_pixbuf_get_height (pixbuf),
+ GDK_RGB_DITHER_NONE,
+ 0, 0);
+
+ return TRUE;
+}
+
+static void
+show_window (uint32_t *bits, int w, int h, int stride)
+{
+ GdkPixbuf *pixbuf;
+
+ GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ pixbuf = pixbuf_from_argb32 (bits, w, h, stride);
+
+ g_signal_connect (window, "expose_event", G_CALLBACK (on_expose), pixbuf);
+ g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
+
+ gtk_widget_show (window);
+
+ gtk_main ();
+}
+
+int
+main (int argc, char **argv)
+{
+#define WIDTH 200
+#define HEIGHT 200
+
+ uint32_t *src = malloc (WIDTH * HEIGHT * 4);
+ pixman_image_t *gradient_img;
+ pixman_image_t *src_img;
+ int i;
+ pixman_gradient_stop_t stops[2] =
+ {
+ { pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } },
+ { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } }
+ };
+ pixman_point_fixed_t p1 = { 0, 0 };
+ pixman_point_fixed_t p2 = { pixman_int_to_fixed (WIDTH),
+ pixman_int_to_fixed (HEIGHT) };
+ pixman_point_fixed_t c_inner;
+ pixman_point_fixed_t c_outer;
+ pixman_fixed_t r_inner;
+ pixman_fixed_t r_outer;
+
+ gtk_init (&argc, &argv);
+
+ for (i = 0; i < WIDTH * HEIGHT; ++i)
+ src[i] = 0xFF0000ff; /* pale blue */
+
+ src_img = pixman_image_create_bits (PIXMAN_a8r8g8b8,
+ WIDTH, HEIGHT,
+ src,
+ WIDTH * 4);
+
+ c_inner.x = pixman_double_to_fixed (100.0);
+ c_inner.y = pixman_double_to_fixed (100.0);
+ c_outer.x = pixman_double_to_fixed (100.0);
+ c_outer.y = pixman_double_to_fixed (100.0);
+ r_inner = 0;
+ r_outer = pixman_double_to_fixed (100.0);
+
+ gradient_img = pixman_image_create_radial_gradient (&c_inner, &c_outer,
+ r_inner, r_outer,
+ stops, 2);
+
+#if 0
+ gradient_img = pixman_image_create_linear_gradient (&p1, &p2,
+ stops, 2);
+
+#endif
+
+ pixman_image_composite (PIXMAN_OP_OVER, gradient_img, NULL, src_img,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+ printf ("0, 0: %x\n", src[0]);
+ printf ("10, 10: %x\n", src[10 * 10 + 10]);
+ printf ("w, h: %x\n", src[(HEIGHT - 1) * 100 + (WIDTH - 1)]);
+
+ show_window (src, WIDTH, HEIGHT, WIDTH);
+
+ pixman_image_unref (gradient_img);
+ pixman_image_unref (src_img);
+ free (src);
+
+ return 0;
+}
commit d5b4fd7e11c2f2b2e8ab3cb95bef252ce142982e
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sat Sep 6 06:17:32 2008 -0400
Update RELEASING
diff --git a/RELEASING b/RELEASING
index 121e0df..7040deb 100644
--- a/RELEASING
+++ b/RELEASING
@@ -37,7 +37,7 @@ Here are the steps to follow to create a new pixman release:
and publish the tar files by running
- make GPGKEY=<your gpg key id> release-publish
+ make PREV=<last version> GPGKEY=<your gpg key id> release-publish
6) Run
commit 35fcdf352a29241f235f2bc7a692c20ad8baf240
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sat Sep 6 06:15:31 2008 -0400
Bump release
diff --git a/RELEASING b/RELEASING
index 3ad0c2d..121e0df 100644
--- a/RELEASING
+++ b/RELEASING
@@ -17,7 +17,9 @@ Here are the steps to follow to create a new pixman release:
make PREV=<last version> release-check
- and fix things until it passes.
+ and fix things until it passes. If your freedesktop username is
+ different from your local username, then also set the variable
+ USERNAME on the commandline.
A very useful thing to do is to run the cairo test suite
against pixman. This can be done by running the following
diff --git a/configure.ac b/configure.ac
index cddf1a7..3821dcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ AC_PREREQ([2.57])
m4_define([pixman_major], 0)
m4_define([pixman_minor], 11)
-m4_define([pixman_micro], 9)
+m4_define([pixman_micro], 10)
m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
commit 5e7388540f2cd201331cb3d1f616e3c300dbc45f
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sat Sep 6 05:14:18 2008 -0400
Check for __sun || __sun in pixman.h. Update TODO
Reported by Bernd Nies.
diff --git a/TODO b/TODO
index 3bed70c..9468021 100644
--- a/TODO
+++ b/TODO
@@ -35,6 +35,10 @@
to indicate the actual depth. That way PIXMAN_x4c4 and PIXMAN_c8
won't collide.
+ - Maybe bite the bullet and make configure.ac generate a pixman-types.h
+ file that can be included from pixman.h to avoid the #ifdef magic
+ in pixman.h
+
- Make pixman_region_point_in() survive a NULL box, then fix up
pixman-compose.c
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 977c0a6..36d91a9 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -74,7 +74,7 @@ SOFTWARE.
/*
* Standard integers
*/
-#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi)
+#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun)
# include <inttypes.h>
#elif defined (_MSC_VER)
typedef __int8 int8_t;
commit f369d612b3d65529e4b10d8a0b1e015407357d9b
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Sat Sep 6 04:33:16 2008 -0400
Use error instead of #error in a couple of other places
diff --git a/configure.ac b/configure.ac
index 66ba962..cddf1a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,7 +128,7 @@ AC_MSG_CHECKING([for -xldscope (Sun compilers)])
AC_COMPILE_IFELSE([
#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#else
-#error Need Sun Studio 8 for visibility
+error Need Sun Studio 8 for visibility
#endif
int main () { return 0; }
], have_sunstudio8=yes)
@@ -149,7 +149,7 @@ xserver_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MMX_CFLAGS"
AC_COMPILE_IFELSE([
#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
-#error "Need GCC >= 3.4 for MMX intrinsics"
+error "Need GCC >= 3.4 for MMX intrinsics"
#endif
#include <mmintrin.h>
int main () {
@@ -243,7 +243,7 @@ xserver_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $VMX_CFLAGS"
AC_COMPILE_IFELSE([
#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
-#error "Need GCC >= 3.4 for sane altivec support"
+error "Need GCC >= 3.4 for sane altivec support"
#endif
#include <altivec.h>
int main () {
commit f921c8c57ffdd6d0afd3d41d50e3565084ebd49c
Author: Peter O'Gorman <pogma@thewrittenword.com>
Date: Fri Aug 15 15:00:24 2008 -0500
Minor portability fixes
Use AC_C_INLINE to figure out `inline'.
IRIX compiler does not exit with a non-zero exit status when it sees #error
diff --git a/configure.ac b/configure.ac
index 9139f38..66ba962 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@ AC_PROG_CC
AC_PROG_LIBTOOL
AC_CHECK_FUNCS([getisax])
AC_C_BIGENDIAN
-
+AC_C_INLINE
#
# We ignore pixman_major in the version here because the major version should
# always be encoded in the actual library name. Ie., the soname is:
@@ -113,7 +113,7 @@ AC_MSG_CHECKING(for -fvisibility)
AC_COMPILE_IFELSE([
#if defined(__GNUC__) && (__GNUC__ >= 4)
#else
-#error Need GCC 4.0 for visibility
+error Need GCC 4.0 for visibility
#endif
int main () { return 0; }
], have_gcc4=yes)
commit e2cbe1a0a4db750ab05d804901f155adb312746b
Author: Frédéric Plourde <frederic.plourde@polymtl.ca>
Date: Thu Sep 4 16:30:21 2008 -0400
Win32 build system fixes
Signed-off-by: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
index f7ecd25..ad30f8c 100644
--- a/pixman/Makefile.win32
+++ b/pixman/Makefile.win32
@@ -3,19 +3,27 @@ LIBRARY = pixman-1
CC = cl
LINK = link
-ifeq ($(CFG),)
-CFG=release
+CFG_VAR = $(CFG)
+ifeq ($(CFG_VAR),)
+CFG_VAR=release
endif
-ifeq ($(MMX),)
-MMX=1
+MMX_VAR = $(MMX)
+ifeq ($(MMX_VAR),)
+MMX_VAR=on
+endif
+
+SSE2_VAR = $(SSE2)
+ifeq ($(SSE2_VAR),)
+SSE2_VAR=on
endif
CFLAGS = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
MMX_CFLAGS = -DUSE_MMX -w14710 -w14714
+SSE2_CFLAGS = -DUSE_SSE2
# optimization flags
-ifeq ($(CFG),debug)
+ifeq ($(CFG_VAR),debug)
CFLAGS += -Od -Zi
else
CFLAGS += -O2
@@ -44,24 +52,31 @@ SOURCES = \
$(NULL)
# MMX compilation flags
-ifeq ($(MMX),1)
+ifeq ($(MMX_VAR),on)
CFLAGS += $(MMX_CFLAGS)
SOURCES += pixman-mmx.c
endif
-OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES))
+# SSE2 compilation flags
+ifeq ($(SSE2_VAR),on)
+CFLAGS += $(SSE2_CFLAGS)
+SOURCES += pixman-sse2.c
+endif
+
+OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
# targets
-all: inform informMMX $(CFG)/$(LIBRARY).lib
+all: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@exit 0
clean: inform clean_r
@exit 0
-pixman: inform informMMX $(CFG)/$(LIBRARY).lib
+pixman: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@exit 0
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
+ifneq ($(CFG),)
@echo "Invalid specified configuration option : "$(CFG)"."
@echo
@echo -n "Possible choices for configuration are "
@@ -69,25 +84,44 @@ ifneq ($(CFG),debug)
@echo ""
@exit 1
endif
+ @echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
+endif
endif
informMMX:
-ifneq ($(MMX),0)
-ifneq ($(MMX),1)
- @echo "Invalid specified MMX option : "$(MMX)"."
+ifneq ($(MMX),off)
+ifneq ($(MMX),on)
+ifneq ($(MMX),)
+ @echo "Invalid specified MMX option : "$(MMX_VAR)"."
@echo
- @echo -n "Possible choices for MMX are 0 or 1"
+ @echo -n "Possible choices for MMX are 'on' or 'off'"
@echo ""
@exit 1
endif
+ @echo "Setting MMX flag to default value 'on'... (use MMX=on or MMX=off)"
+endif
+endif
+
+informSSE2:
+ifneq ($(SSE2),off)
+ifneq ($(SSE2),on)
+ifneq ($(SSE2),)
+ @echo "Invalid specified SSE option : "$(SSE2)"."
+ @echo
+ @echo -n "Possible choices for SSE2 are 'on' or 'off'"
+ @echo ""
+ @exit 1
+endif
+ @echo "Setting SSE2 flag to default value 'on'... (use SSE2=on or SSE2=off)"
+endif
endif
# pixman compilation and linking
-$(CFG)/%.obj: %.c
- @mkdir -p $(CFG)
+$(CFG_VAR)/%.obj: %.c
+ @mkdir -p $(CFG_VAR)
@$(CC) -c $(CFLAGS) -Fo"$@" $<
-$(CFG)/$(LIBRARY).lib: $(OBJECTS)
+$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
lib -NOLOGO -OUT:$@ $(OBJECTS) || exit 0
pixman-combine32.c: combine.inc pixman-combine32.h combine.pl
@@ -101,5 +135,5 @@ pixman-combine64.h: combine.h.inc combine.pl
perl ./combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
clean_r:
- @rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
+ @rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.lib $(CFG_VAR)/*.pdb $(CFG)/*.ilk || exit 0
@rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk pixman-combine32.c pixman-combine64.c || exit 0
commit ed862f1b2f62ee27884b9b429c54162039f3cb10
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Thu Sep 4 16:21:08 2008 -0400
Make sure pixman-combine{32,64}.h are disted
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index b9ce896..399fb7d 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -11,7 +11,9 @@ libpixman_1_la_SOURCES = \
pixman-private.h \
pixman-image.c \
pixman-combine32.c \
+ pixman-combine32.h \
pixman-combine64.c \
+ pixman-combine64.h \
pixman-compose.c \
pixman-compose-accessors.c \
pixman-pict.c \
commit f9d3f372f907c997abe4c4a65cc4a3dbe0bb41e2
Author: Søren Sandmann Pedersen <sandmann@redhat.com>
Date: Sun Aug 24 00:40:16 2008 -0400
Rename pixman-sse.h pixman-sse2.h
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 200a2da..193ea28 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -33,7 +33,7 @@
#include "pixman-private.h"
#include "pixman-mmx.h"
#include "pixman-vmx.h"
-#include "pixman-sse.h"
+#include "pixman-sse2.h"
#include "pixman-combine32.h"
#ifdef __GNUC__
diff --git a/pixman/pixman-sse.h b/pixman/pixman-sse.h
deleted file mode 100644
index 2bcbf97..0000000
--- a/pixman/pixman-sse.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright © 2008 Rodrigo Kumpera
- * Copyright © 2008 André Tupinambá
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Author: Rodrigo Kumpera (kumpera@gmail.com)
- * André Tupinambá (andrelrt@gmail.com)
- *
- * Based on work by Owen Taylor and Søren Sandmann
- */
-#ifndef _PIXMAN_SSE_H_
-#define _PIXMAN_SSE_H_
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "pixman-private.h"
-
-#ifdef USE_SSE2
-
-#if !defined(__amd64__) && !defined(__x86_64__)
-pixman_bool_t pixman_have_sse2(void);
-#else
-#define pixman_have_sse2() TRUE
-#endif
-
-#else
-#define pixman_have_sse2() FALSE
-#endif
-
-#ifdef USE_SSE2
-
-void fbComposeSetupSSE2(void);
-
-pixman_bool_t
-pixmanFillsse2 (uint32_t *bits,
- int stride,
- int bpp,
- int x,
- int y,
- int width,
- int height,
- uint32_t data);
-
-pixman_bool_t
-pixmanBltsse2 (uint32_t *src_bits,
- uint32_t *dst_bits,
- int src_stride,
- int dst_stride,
- int src_bpp,
- int dst_bpp,
- int src_x, int src_y,
- int dst_x, int dst_y,
- int width, int height);
-
-void
-fbCompositeSolid_nx8888sse2 (pixman_op_t op,
- pixman_image_t * pSrc,
- pixman_image_t * pMask,
- pixman_image_t * pDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height);
-
-void
Reply to: