GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_24xrgb_setup.c Lines: 58 58 100.0 %
Date: 2024-12-05 08:52:37 Branches: 0 0 - %

Line Branch Exec Source
1
2
/***************************************************************************
3
 * Copyright (c) 2024 Microsoft Corporation
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   Display Management (Display)                                        */
19
/**                                                                       */
20
/**************************************************************************/
21
#define GX_SOURCE_CODE
22
23
#include "gx_api.h"
24
#include "gx_display.h"
25
26
#if defined(GX_MOUSE_SUPPORT) && !defined(GX_HARDWARE_MOUSE_SUPPORT)
27
static GX_COLOR mouse_capture_memory[GX_MOUSE_MAX_RESOLUTION * GX_MOUSE_MAX_RESOLUTION] = { 0 };
28
#endif
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_display_driver_24xrgb_setup                     PORTABLE C      */
35
/*                                                           6.1.3        */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION                                                           */
41
/*                                                                        */
42
/*    Generic 32-bit XRGB color format display driver setup routine.      */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    display                               The display control block     */
47
/*    aux_data                              Driver-defined auxiliary data */
48
/*    toggle_function                       Driver-defined screen toggle  */
49
/*                                            function                    */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    None                                                                */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    None                                                                */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    GUIX Internal Code                                                  */
62
/*                                                                        */
63
/*  RELEASE HISTORY                                                       */
64
/*                                                                        */
65
/*    DATE              NAME                      DESCRIPTION             */
66
/*                                                                        */
67
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
68
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
69
/*                                            resulting in version 6.1    */
70
/*  12-31-2020     Kenneth Maxwell          Modified comment(s),          */
71
/*                                            added rotation angle        */
72
/*                                            initialization,             */
73
/*                                            resulting in version 6.1.3  */
74
/*                                                                        */
75
/**************************************************************************/
76
398
VOID _gx_display_driver_24xrgb_setup(GX_DISPLAY *display, VOID *aux_data,
77
                                     VOID (*toggle_function)(struct GX_CANVAS_STRUCT *canvas,
78
                                                             GX_RECTANGLE *dirty_area))
79
{
80
    /* Default initiate and complete function to null for general condition. */
81
398
    display -> gx_display_driver_drawing_initiate              = GX_NULL;
82
398
    display -> gx_display_driver_drawing_complete              = GX_NULL;
83
84
#if defined(GX_MOUSE_SUPPORT)
85
#if defined(GX_HARDWARE_MOUSE_SUPPORT)
86
    display -> gx_display_mouse_position_set                   = GX_NULL;
87
    display -> gx_display_mouse_enable                         = GX_NULL;
88
#else
89
    display -> gx_display_mouse.gx_mouse_capture_memory        = (GX_UBYTE *)mouse_capture_memory;
90
    display -> gx_display_mouse.gx_mouse_status                = 0;
91
92
    display -> gx_display_mouse.gx_mouse_position.gx_point_x   = display -> gx_display_width / 2;
93
    display -> gx_display_mouse.gx_mouse_position.gx_point_y   = display -> gx_display_height / 2;
94
95
    /* these functions are specific to the display color format, and will be NULL for hardware mouse */
96
    display -> gx_display_mouse_capture                        = _gx_display_driver_24xrgb_mouse_capture;
97
    display -> gx_display_mouse_restore                        = _gx_display_driver_24xrgb_mouse_restore;
98
    display -> gx_display_mouse_draw                           = _gx_display_driver_generic_mouse_draw;
99
    display -> gx_display_driver_drawing_initiate              = _gx_display_driver_generic_drawing_initiate;
100
    display -> gx_display_driver_drawing_complete              = _gx_display_driver_generic_drawing_complete;
101
    display -> gx_display_mouse_position_set                   = _gx_display_driver_generic_mouse_position_set;
102
    display -> gx_display_mouse_enable                         = _gx_display_driver_generic_mouse_enable;
103
#endif
104
105
    /* these functions are generic, same for every color depth, but will be overridden for hardware mouse */
106
    display -> gx_display_mouse.gx_mouse_cursor_info           = GX_NULL;
107
    display -> gx_display_mouse_define                         = _gx_display_driver_generic_mouse_define;
108
#endif
109
110
398
    display -> gx_display_rotation_angle                       = 0;
111
398
    display -> gx_display_driver_data                          = (VOID *)aux_data;
112
398
    display -> gx_display_accelerator                          = GX_NULL;
113
398
    display -> gx_display_layer_services                       = GX_NULL;
114
398
    display -> gx_display_driver_callback_assign               = GX_NULL;
115
116
398
    display -> gx_display_color_format                         = GX_COLOR_FORMAT_24XRGB;
117
398
    display -> gx_display_driver_canvas_copy                   = _gx_display_driver_32bpp_canvas_copy;
118
398
    display -> gx_display_driver_simple_line_draw              = _gx_display_driver_32bpp_simple_line_draw;
119
398
    display -> gx_display_driver_horizontal_line_draw          = _gx_display_driver_32bpp_horizontal_line_draw;
120
398
    display -> gx_display_driver_vertical_line_draw            = _gx_display_driver_32bpp_vertical_line_draw;
121
398
    display -> gx_display_driver_horizontal_pattern_line_draw  = _gx_display_driver_32bpp_horizontal_pattern_line_draw;
122
398
    display -> gx_display_driver_vertical_pattern_line_draw    = _gx_display_driver_32bpp_vertical_pattern_line_draw;
123
398
    display -> gx_display_driver_horizontal_pixelmap_line_draw = _gx_display_driver_32bpp_horizontal_pixelmap_line_draw;
124
398
    display -> gx_display_driver_pixel_write                   = _gx_display_driver_32bpp_pixel_write;
125
398
    display -> gx_display_driver_block_move                    = _gx_display_driver_32bpp_block_move;
126
127
398
    display -> gx_display_driver_native_color_get              = _gx_display_driver_24xrgb_native_color_get;
128
398
    display -> gx_display_driver_row_pitch_get                 = _gx_display_driver_32bpp_row_pitch_get;
129
398
    display -> gx_display_driver_pixelmap_draw                 = _gx_display_driver_24xrgb_pixelmap_draw;
130
398
    display -> gx_display_driver_pixelmap_rotate               = _gx_display_driver_32bpp_pixelmap_rotate;
131
398
    display -> gx_display_driver_alphamap_draw                 = _gx_display_driver_generic_alphamap_draw;
132
398
    display -> gx_display_driver_simple_wide_line_draw         = _gx_display_driver_generic_simple_wide_line_draw;
133
398
    display -> gx_display_driver_polygon_draw                  = _gx_display_driver_generic_polygon_draw;
134
398
    display -> gx_display_driver_polygon_fill                  = _gx_display_driver_generic_polygon_fill;
135
136
398
    display -> gx_display_driver_anti_aliased_line_draw        = _gx_display_driver_generic_aliased_line_draw;
137
398
    display -> gx_display_driver_anti_aliased_wide_line_draw   = _gx_display_driver_generic_aliased_wide_line_draw;
138
139
#if defined(GX_ARC_DRAWING_SUPPORT)
140
141
398
    display -> gx_display_driver_anti_aliased_circle_draw      = _gx_display_driver_generic_aliased_circle_draw;
142
398
    display -> gx_display_driver_anti_aliased_ellipse_draw     = _gx_display_driver_generic_aliased_ellipse_draw;
143
398
    display -> gx_display_driver_circle_draw                   = _gx_display_driver_generic_circle_draw;
144
398
    display -> gx_display_driver_circle_fill                   = _gx_display_driver_generic_circle_fill;
145
398
    display -> gx_display_driver_pie_fill                      = _gx_display_driver_generic_pie_fill;
146
398
    display -> gx_display_driver_anti_aliased_arc_draw         = _gx_display_driver_generic_aliased_arc_draw;
147
398
    display -> gx_display_driver_arc_draw                      = _gx_display_driver_generic_arc_draw;
148
398
    display -> gx_display_driver_arc_fill                      = _gx_display_driver_generic_arc_fill;
149
398
    display -> gx_display_driver_ellipse_draw                  = _gx_display_driver_generic_ellipse_draw;
150
398
    display -> gx_display_driver_ellipse_fill                  = _gx_display_driver_generic_ellipse_fill;
151
398
    display -> gx_display_driver_anti_aliased_wide_circle_draw = _gx_display_driver_generic_aliased_wide_circle_draw;
152
398
    display -> gx_display_driver_wide_circle_draw              = _gx_display_driver_generic_wide_circle_draw;
153
398
    display -> gx_display_driver_anti_aliased_wide_ellipse_draw= _gx_display_driver_generic_aliased_wide_ellipse_draw;
154
398
    display -> gx_display_driver_wide_ellipse_draw             = _gx_display_driver_generic_wide_ellipse_draw;
155
398
    display -> gx_display_driver_anti_aliased_wide_arc_draw    = _gx_display_driver_generic_aliased_wide_arc_draw;
156
398
    display -> gx_display_driver_wide_arc_draw                 = _gx_display_driver_generic_wide_arc_draw;
157
#endif
158
159
398
    display -> gx_display_driver_palette_set                   = GX_NULL;
160
398
    display -> gx_display_driver_buffer_toggle                 = toggle_function;
161
162
398
    display -> gx_display_driver_canvas_blend                  = _gx_display_driver_24xrgb_canvas_blend;
163
398
    display -> gx_display_driver_pixel_blend                   = _gx_display_driver_24xrgb_pixel_blend;
164
398
    display -> gx_display_driver_pixelmap_blend                = _gx_display_driver_24xrgb_pixelmap_blend;
165
166
398
    display -> gx_display_driver_8bit_glyph_draw               = _gx_display_driver_generic_glyph_8bit_draw;
167
398
    display -> gx_display_driver_4bit_glyph_draw               = _gx_display_driver_generic_glyph_4bit_draw;
168
398
    display -> gx_display_driver_1bit_glyph_draw               = _gx_display_driver_32bpp_glyph_1bit_draw;
169
170
398
    display -> gx_display_driver_8bit_compressed_glyph_draw    = GX_NULL;
171
398
    display -> gx_display_driver_4bit_compressed_glyph_draw    = GX_NULL;
172
398
    display -> gx_display_driver_1bit_compressed_glyph_draw    = GX_NULL;
173
174
#if defined(GX_SOFTWARE_DECODER_SUPPORT)
175
398
    display -> gx_display_driver_jpeg_draw                     = _gx_display_driver_24xrgb_jpeg_draw;
176
398
    display -> gx_display_driver_png_draw                      = _gx_display_driver_24xrgb_png_draw;
177
#endif
178
398
}
179