summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <soren.sandmann@gmail.com>2018-01-27 23:22:24 -0500
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>2018-01-27 23:22:24 -0500
commit2f52f3b6caec02206ffaae6b768a07f4d6d7b5e5 (patch)
tree180e6a3f125ee987ddb909d16f17c81e04d687e8
parentcf0066ae050da44bbf850a0a812b1396da48ac31 (diff)
shapespolygon
-rw-r--r--demos/gtk-utils.c1
-rw-r--r--demos/shapes.c37
-rw-r--r--demos/wheel.c2
3 files changed, 22 insertions, 18 deletions
diff --git a/demos/gtk-utils.c b/demos/gtk-utils.c
index 32d4aecc..c803477e 100644
--- a/demos/gtk-utils.c
+++ b/demos/gtk-utils.c
@@ -144,6 +144,7 @@ show_image (pixman_image_t *image)
width = pixman_image_get_width (image);
height = pixman_image_get_height (image);
+ printf ("Setting size: %d %d\n", width, height);
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
format = pixman_image_get_format (image);
diff --git a/demos/shapes.c b/demos/shapes.c
index 2f2b85a6..daa800dd 100644
--- a/demos/shapes.c
+++ b/demos/shapes.c
@@ -126,8 +126,8 @@ make_star (int width, int height)
&builder, PIXMAN_FILL_RULE_WINDING, FALSE);
}
-#define COLUMNS 3
-#define WIDTH 800
+#define COLUMNS 4
+#define WIDTH 1600
#define HEIGHT (WIDTH / (2 * COLUMNS) * 4)
#define PAD 20
@@ -136,7 +136,7 @@ main (int argc, char **argv)
{
pixman_image_t *src, *mask, *dest_srgb, *dest_linear;
pixman_image_t *m;
- pixman_color_t colors[10][2] = {
+ pixman_color_t colors[][2] = {
{ { 0x0000, 0x0000, 0x0000, 0xffff },
{ 0xfffe, 0xfffe, 0xfffe, 0xffff },
},
@@ -153,21 +153,23 @@ main (int argc, char **argv)
{ 0x0000, 0x0000, 0xfffe, 0xffff },
},
{ { 0x0000, 0xfffe, 0xfffe, 0xffff },
- { 0xfffe, 0x0000, 0x0000, 0xffff },
- },
+ { 0xfffe, 0x0000, 0x0000, 0xffff },
+ },
{ { 0xffff, 0x6666, 0x0000, 0xffff },
- { 0x9999, 0x0000, 0x6666, 0xffff },
- },
+ { 0x9999, 0x0000, 0x6666, 0xffff },
+ },
{ { 0xfffe, 0x0000, 0x0000, 0xffff },
- { 0x0000, 0xfffe, 0xfffe, 0xffff },
- },
+ { 0x0000, 0xfffe, 0xfffe, 0xffff },
+ },
{ { 0x0000, 0xffff, 0x0000, 0xffff },
- { 0xffff, 0x0000, 0x0000, 0xffff },
- },
+ { 0xffff, 0x0000, 0x0000, 0xffff },
+ },
{ { 0x3333, 0x8888, 0x3333, 0xffff },
- { 0x0000, 0x0000, 0x0000, 0xffff },
- },
-#if 0
+ { 0x0000, 0x0000, 0x0000, 0xffff },
+ },
+ { { 0x0000, 0x0000, 0xffff, 0xffff },
+ { 0xffff, 0xffff, 0x0000, 0xffff },
+ },
/* Some color combinations used on Google Maps */
{ { 0x6052, 0x855f, 0xb919, 0xffff },
{ 0x9732, 0xbce7, 0x66e8, 0xffff },
@@ -184,7 +186,6 @@ main (int argc, char **argv)
{ { 0xffff, 0xfb74, 0x4218, 0xffff },
{ 0xbed2, 0x9a94, 0x699c, 0xffff },
},
-#endif
};
uint32_t *d;
@@ -222,9 +223,11 @@ main (int argc, char **argv)
0, 0, 0, 0,
x * sw, y * sw, sw, sw);
- mask = make_wheel (sw, sw, 25, 3.0);
m = pixman_image_create_bits (PIXMAN_a8, sw, sw, NULL, -1);
- pixman_image_composite (PIXMAN_OP_SRC, mask, NULL, m, 0, 0, 0, 0, 0, 0, sw, sw);
+ pixman_image_composite (PIXMAN_OP_SRC,
+ make_wheel(sw, sw, 36, 2), NULL, m,
+ 0, 0, 0, 0,
+ 0, 0, sw, sw);
pixman_image_composite (PIXMAN_OP_XOR,
make_star (sw, sw), NULL, m,
0, 0, 0, 0, 0, 0, sw, sw);
diff --git a/demos/wheel.c b/demos/wheel.c
index 4c416d44..849f8dc2 100644
--- a/demos/wheel.c
+++ b/demos/wheel.c
@@ -62,7 +62,7 @@ make_wheel (void)
{
polygon_builder_t builder;
pixman_f_transform_t transform;
- double w = 1/150.0;
+ double w = 1/300.0;
int n_spokes = 50;
double step = (M_PI * 2) / n_spokes;
int i;