1 /* This is a small demo of the high-performance GUIX graphics framework. */
2
3 #include <stdio.h>
4 #include "tx_api.h"
5 #include "gx_api.h"
6 #include "gx_validation_utility.h"
7
8 TEST_PARAM test_parameter = {
9 "guix_synergy_4444argb_32bpp", /* Test name */
10 19, 14, 189, 184 /* Define the coordinates of the capture area.
11 In this test, we only need to capture the pixelmap
12 drawing area. */
13 };
14
15 static VOID control_thread_entry(ULONG);
main(int argc,char ** argv)16 int main(int argc, char ** argv)
17 {
18 /* Parse the command line argument. */
19 gx_validation_setup(argc, argv);
20
21 /* Start ThreadX system */
22 tx_kernel_enter();
23 return(0);
24 }
25
tx_application_define(void * first_unused_memory)26 VOID tx_application_define(void *first_unused_memory)
27 {
28
29 /* Create a dedicated thread to perform various operations
30 on the pixelmap drawing example. These operations simulate
31 user input. */
32 gx_validation_control_thread_create(control_thread_entry);
33
34 /* Termiante the test if it runs for more than 100 ticks */
35 /* This function is not implemented yet. */
36 gx_validation_watchdog_create(100);
37
38 /* Call the actual line example routine. */
39 gx_validation_application_define(first_unused_memory);
40
41 }
42
43
44 /* Replace the default graphics driver with the validation driver. */
45 #ifdef win32_dave2d_graphics_driver_setup_24xrgb
46 #undef win32_dave2d_graphics_driver_setup_24xrgb
47 #endif
48 #define win32_dave2d_graphics_driver_setup_24xrgb gx_validation_dave2d_graphics_driver_setup_24xrgb
49
50
51 #ifdef WIN32
52 #undef WIN32
53 #endif
54
55 #include "gx_validation_wrapper.h"
56
57 #include "demo_synergy_4444argb_32bpp.c"
58 /* Define the move values for the horizontal slider. */
59
60 /* Define the move values for the vertical slider.*/
61
62 /* Define the alpha settings. */
63
64 /* Define the compressed settings. */
65 int format_value[4] = {GX_PIXELMAP_ID_RED_APPLE,GX_PIXELMAP_ID_ICON_FOOT_ALPHA,GX_PIXELMAP_ID_RAINBOW200_ALPHA_NONCOMPRESS,GX_PIXELMAP_ID_RAINBOW200_ALPHA_COMPRESS};
66 /* Define the y coordinate of mouse click.*/
67
68 char test_comment[256];
69
70 /* This thread simulates user input. Its priority is lower
71 than the GUIX thread, so that GUIX finishes an operation
72 before this thread is able to issue the next command. */
control_thread_entry(ULONG input)73 static VOID control_thread_entry(ULONG input)
74 {
75 int format_index;
76 int frame_id = 1;
77
78
79 for(format_index = 0 ; format_index <(int)(sizeof(format_value)/sizeof(int)); format_index++)
80 {
81 format = format_value[format_index];
82 /* Inform the validation system
83 (1) Frame ID, which identifies a specific test configuration;
84 (2) Start recording frame on the next toggle operation.
85 */
86 gx_validation_set_frame_id(frame_id);
87
88 /* Set the vertical slider value */
89 switch (format)
90 {
91
92 case GX_PIXELMAP_ID_RED_APPLE:
93 strcat(test_comment, "uncompressed for 4444BGRA\n ");
94 break;
95
96 case GX_PIXELMAP_ID_ICON_FOOT_ALPHA:
97 strcat(test_comment, "compressed for 4444BGRA\n ");
98 break;
99
100 case GX_PIXELMAP_ID_RAINBOW200_ALPHA_COMPRESS:
101 strcat(test_comment, "compressed for 4444ARGB\n ");
102 break;
103
104 case GX_PIXELMAP_ID_RAINBOW200_ALPHA_NONCOMPRESS:
105 strcat(test_comment, "uncompressed for 4444ARGB\n ");
106 break;
107
108 }
109 gx_validation_set_frame_comment(test_comment);
110
111 /* Mark the window "dirty" */
112 gx_system_dirty_mark(pic_window);
113
114 /* Force a screen refresh. */
115 gx_validation_screen_refresh();
116
117 /* Increment frame ID */
118 frame_id ++;
119
120 }
121
122
123
124 /* Signal the end of the test case. Verify the output. */
125 gx_validation_end();
126
127 exit(0);
128 }
129
130
131