1 /* This is a small demo of the high-performance GUIX graphics framework. */
2
3
4 #include <stdio.h>
5 #include "tx_api.h"
6 #include "gx_api.h"
7 #include "gx_validation_utility.h"
8
9 TEST_PARAM test_parameter = {
10 "guix_synergy_text_rotation", /* Test name */
11 0, 0, 639, 479 /* Define the coordinates of the capture area.
12 In this test, we only need to capture the pixelmap
13 drawing area. */
14 };
15
16 static VOID control_thread_entry(ULONG);
main(int argc,char ** argv)17 int main(int argc, char ** argv)
18 {
19 /* Parse the command line argument. */
20 gx_validation_setup(argc, argv);
21
22 /* Start ThreadX system */
23 tx_kernel_enter();
24 return(0);
25 }
26
tx_application_define(void * first_unused_memory)27 VOID tx_application_define(void *first_unused_memory)
28 {
29
30 /* Create a dedicated thread to perform various operations
31 on the pixelmap drawing example. These operations simulate
32 user input. */
33 gx_validation_control_thread_create(control_thread_entry);
34
35 /* Termiante the test if it runs for more than 100 ticks */
36 /* This function is not implemented yet. */
37 gx_validation_watchdog_create(100);
38
39 /* Call the actual line example routine. */
40 gx_validation_application_define(first_unused_memory);
41
42 }
43
44
45 /* Replace the default graphics driver with the validation driver. */
46 #ifdef win32_dave2d_graphics_driver_setup_24xrgb
47 #undef win32_dave2d_graphics_driver_setup_24xrgb
48 #endif
49 #define win32_dave2d_graphics_driver_setup_24xrgb gx_validation_dave2d_graphics_driver_setup_24xrgb
50
51
52
53 #ifdef WIN32
54 #undef WIN32
55 #endif
56
57 #include "gx_validation_wrapper.h"
58
59 #include "demo_synergy_text_rotation.c"
60
61 /*NOTICE: Number of xpos_value and ypos_valus should be same.*/
62 extern INT text_angle;
63
64 char test_comment[256];
65
66 /* This thread simulates user input. Its priority is lower
67 than the GUIX thread, so that GUIX finishes an operation
68 before this thread is able to issue the next command. */
control_thread_entry(ULONG input)69 static VOID control_thread_entry(ULONG input)
70 {
71 int frame_id = 1;
72
73 for(text_angle = 0; text_angle < 360; text_angle++)
74 {
75
76 /* Inform the validation system
77 (1) Frame ID, which identifies a specific test configuration;
78 (2) Start recording frame on the next toggle operation.
79 */
80 gx_validation_set_frame_id(frame_id++);
81 sprintf(test_comment, "text angle = %d", text_angle);
82 gx_validation_set_frame_comment(test_comment);
83 gx_validation_screen_refresh();
84 }
85
86 /* Signal the end of the test case. Verify the output. */
87 gx_validation_end();
88
89 exit(0);
90 }
91