• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "../test/utils.h"
2 #include "gtk-utils.h"
3 
4 #define WIDTH 1024
5 #define HEIGHT 640
6 
7 int
main(int argc,char ** argv)8 main (int argc, char **argv)
9 {
10     pixman_image_t *src_img, *dest_img;
11     pixman_gradient_stop_t stops[] = {
12         { 0x00000, { 0x0000, 0x0000, 0x4444, 0xdddd } },
13         { 0x10000, { 0xeeee, 0xeeee, 0x8888, 0xdddd } },
14 #if 0
15         /* These colors make it very obvious that dithering
16          * is useful even for 8-bit gradients
17          */
18 	{ 0x00000, { 0x6666, 0x3333, 0x3333, 0xffff } },
19 	{ 0x10000, { 0x3333, 0x6666, 0x6666, 0xffff } },
20 #endif
21     };
22     pixman_point_fixed_t p1, p2;
23 
24     enable_divbyzero_exceptions ();
25 
26     dest_img = pixman_image_create_bits (PIXMAN_x8r8g8b8,
27 					 WIDTH, HEIGHT,
28 					 NULL, 0);
29 
30     p1.x = p1.y = 0x0000;
31     p2.x = WIDTH << 16;
32     p2.y = HEIGHT << 16;
33 
34     src_img = pixman_image_create_linear_gradient (&p1, &p2, stops, ARRAY_LENGTH (stops));
35 
36     pixman_image_composite32 (PIXMAN_OP_OVER,
37 			      src_img,
38 			      NULL,
39 			      dest_img,
40 			      0, 0,
41 			      0, 0,
42 			      0, 0,
43 			      WIDTH, HEIGHT);
44 
45     show_image (dest_img);
46 
47     pixman_image_unref (dest_img);
48 
49     return 0;
50 }
51