pixman: Branch 'master' - 2 commits
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Tue Sep 15 13:32:52 PDT 2009
Rebased ref, commits from common ancestor:
commit 8400249c6452c9b31bacf5952befc9fe747d5fa1
Author: Søren Sandmann Pedersen <ssp at dhcp-100-3-19.bos.redhat.com>
Date: Mon Sep 14 22:54:05 2009 -0400
Fix a bunch of warnings.
diff --git a/test/alpha-test.c b/test/alpha-test.c
index e2b97c7..649a1cd 100644
--- a/test/alpha-test.c
+++ b/test/alpha-test.c
@@ -14,7 +14,9 @@ main (int argc, char **argv)
uint32_t *src = malloc (WIDTH * HEIGHT * 4);
pixman_image_t *grad_img;
pixman_image_t *alpha_img;
+#if 0
pixman_image_t *solid_img;
+#endif
pixman_image_t *dest_img;
pixman_image_t *src_img;
int i;
@@ -26,12 +28,14 @@ main (int argc, char **argv)
pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 };
pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH),
pixman_int_to_fixed (0) };
+#if 0
pixman_transform_t trans = {
{ { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
{ pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
{ pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) }
}
};
+#endif
pixman_transform_t id = {
{ { pixman_fixed_1, 0, 0 },
@@ -43,7 +47,9 @@ main (int argc, char **argv)
pixman_point_fixed_t c_outer;
pixman_fixed_t r_inner;
pixman_fixed_t r_outer;
+#if 0
pixman_color_t red = { 0xffff, 0x0000, 0x0000, 0xffff };
+#endif
for (i = 0; i < WIDTH * HEIGHT; ++i)
alpha[i] = 0x4f00004f; /* pale blue */
diff --git a/test/clip-test.c b/test/clip-test.c
index 9000137..a9a0396 100644
--- a/test/clip-test.c
+++ b/test/clip-test.c
@@ -21,28 +21,32 @@ create_solid_bits (uint32_t pixel)
WIDTH * 4);
}
+#define D2F(d) (pixman_double_to_fixed (d))
+
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 } },
- { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } }
- };
+ {
+ { pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } },
+ { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } }
+ };
+#if 0
pixman_point_fixed_t p1 = { 0, 0 };
pixman_point_fixed_t p2 = { pixman_int_to_fixed (WIDTH),
pixman_int_to_fixed (HEIGHT) };
+#endif
pixman_point_fixed_t c_inner;
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) }
+ { { D2F (1.3), D2F (0.0), D2F (-0.5), },
+ { D2F (0.0), D2F (1.0), D2F (-0.5), },
+ { D2F (0.0), D2F (0.0), D2F ( 1.0) }
}
};
diff --git a/test/composite-test.c b/test/composite-test.c
index 49e0220..48abac5 100644
--- a/test/composite-test.c
+++ b/test/composite-test.c
@@ -113,7 +113,7 @@ main (int argc, char **argv)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_default_size (window, 800, 600);
+ gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_main_quit),
diff --git a/test/gradient-test.c b/test/gradient-test.c
index 2593ee3..c10109d 100644
--- a/test/gradient-test.c
+++ b/test/gradient-test.c
@@ -3,6 +3,8 @@
#include "pixman.h"
#include "utils.h"
+#define d2f pixman_double_to_fixed
+
int
main (int argc, char **argv)
{
@@ -21,12 +23,14 @@ main (int argc, char **argv)
pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 };
pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH / 8.),
pixman_int_to_fixed (0) };
+#if 0
pixman_transform_t trans = {
- { { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
- { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
- { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) }
+ { { d2f (2), d2f (0.5), d2f (-100), },
+ { d2f (0), d2f (3), d2f (0), },
+ { d2f (0), d2f (0.000), d2f (1.0) }
}
};
+#endif
pixman_transform_t id = {
{ { pixman_fixed_1, 0, 0 },
diff --git a/test/utils.h b/test/utils.h
index bc110d8..6d0fe1c 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -1,6 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
+#include <gtk/gtk.h>
#include "pixman.h"
-void show_image (pixman_image_t *image);
+void show_image (pixman_image_t *image);
+GdkPixbuf *pixbuf_from_argb32 (uint32_t *bits,
+ gboolean has_alpha,
+ int width,
+ int height,
+ int stride);
commit cbeb832def8dc18f79447c19d422f583f2887cdf
Author: Søren Sandmann Pedersen <ssp at dhcp-100-3-19.bos.redhat.com>
Date: Fri Sep 11 23:51:05 2009 -0400
Special-case pixman_blt_sse2() for when both src and dest are aligned.
In that case we can use the movdqa instruction which is supposedly faster.
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 56fda4d..954f356 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5359,27 +5359,57 @@ pixman_blt_sse2 (uint32_t *src_bits,
cache_prefetch_next ((__m128i*)s);
cache_prefetch_next ((__m128i*)d);
- while (w >= 64)
+ if ((unsigned long)s & 15)
{
- __m128i xmm0, xmm1, xmm2, xmm3;
-
- /* 128 bytes ahead */
- cache_prefetch (((__m128i*)s) + 8);
- cache_prefetch (((__m128i*)d) + 8);
-
- xmm0 = load_128_unaligned ((__m128i*)(s));
- xmm1 = load_128_unaligned ((__m128i*)(s + 16));
- xmm2 = load_128_unaligned ((__m128i*)(s + 32));
- xmm3 = load_128_unaligned ((__m128i*)(s + 48));
-
- save_128_aligned ((__m128i*)(d), xmm0);
- save_128_aligned ((__m128i*)(d + 16), xmm1);
- save_128_aligned ((__m128i*)(d + 32), xmm2);
- save_128_aligned ((__m128i*)(d + 48), xmm3);
-
- s += 64;
- d += 64;
- w -= 64;
+ /* Source is unaligned */
+ while (w >= 64)
+ {
+ __m128i xmm0, xmm1, xmm2, xmm3;
+
+ /* 128 bytes ahead */
+ cache_prefetch (((__m128i*)s) + 8);
+ cache_prefetch (((__m128i*)d) + 8);
+
+ xmm0 = load_128_unaligned ((__m128i*)(s));
+ xmm1 = load_128_unaligned ((__m128i*)(s + 16));
+ xmm2 = load_128_unaligned ((__m128i*)(s + 32));
+ xmm3 = load_128_unaligned ((__m128i*)(s + 48));
+
+ save_128_aligned ((__m128i*)(d), xmm0);
+ save_128_aligned ((__m128i*)(d + 16), xmm1);
+ save_128_aligned ((__m128i*)(d + 32), xmm2);
+ save_128_aligned ((__m128i*)(d + 48), xmm3);
+
+ s += 64;
+ d += 64;
+ w -= 64;
+ }
+ }
+ else
+ {
+ /* Source is aligned */
+ while (w >= 64)
+ {
+ __m128i xmm0, xmm1, xmm2, xmm3;
+
+ /* 128 bytes ahead */
+ cache_prefetch (((__m128i*)s) + 8);
+ cache_prefetch (((__m128i*)d) + 8);
+
+ xmm0 = load_128_aligned ((__m128i*)(s));
+ xmm1 = load_128_aligned ((__m128i*)(s + 16));
+ xmm2 = load_128_aligned ((__m128i*)(s + 32));
+ xmm3 = load_128_aligned ((__m128i*)(s + 48));
+
+ save_128_aligned ((__m128i*)(d), xmm0);
+ save_128_aligned ((__m128i*)(d + 16), xmm1);
+ save_128_aligned ((__m128i*)(d + 32), xmm2);
+ save_128_aligned ((__m128i*)(d + 48), xmm3);
+
+ s += 64;
+ d += 64;
+ w -= 64;
+ }
}
cache_prefetch_next ((__m128i*)s);
More information about the xorg-commit
mailing list