GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_8bit_palette_setup.c Lines: 54 54 100.0 %
Date: 2026-03-06 19:21:09 Branches: 0 0 - %

Line Branch Exec Source
1
2
/***************************************************************************
3
 * Copyright (c) 2024 Microsoft Corporation
4
 * Copyright (c) 2026-present Eclipse ThreadX contributors
5
 *
6
 * This program and the accompanying materials are made available under the
7
 * terms of the MIT License which is available at
8
 * https://opensource.org/licenses/MIT.
9
 *
10
 * SPDX-License-Identifier: MIT
11
 **************************************************************************/
12
13
14
/**************************************************************************/
15
/**************************************************************************/
16
/**                                                                       */
17
/** GUIX Component                                                        */
18
/**                                                                       */
19
/**   Display Management (Display)                                        */
20
/**                                                                       */
21
/**************************************************************************/
22
23
24
#define GX_SOURCE_CODE
25
26
27
/* Include necessary system files.  */
28
29
#include "gx_api.h"
30
#include "gx_display.h"
31
32
#if defined(GX_MOUSE_SUPPORT) && !defined(GX_HARDWARE_MOUSE_SUPPORT)
33
static GX_UBYTE mouse_capture_memory[GX_MOUSE_MAX_RESOLUTION * GX_MOUSE_MAX_RESOLUTION] = { 0 };
34
#endif
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _gx_display_driver_8bit_palette_setup               PORTABLE C      */
40
/*                                                           6.1.3        */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    Kenneth Maxwell, Microsoft Corporation                              */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    8-bit palettte color format display driver setup routine.           */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    display                               The display control block     */
52
/*    aux_data                              Driver-defined auxiliary data */
53
/*    toggle_function                       Driver-defined screen toggle  */
54
/*                                            function                    */
55
/*                                                                        */
56
/*  OUTPUT                                                                */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    None                                                                */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    GUIX Internal Code                                                  */
67
/*                                                                        */
68
/**************************************************************************/
69
80
VOID     _gx_display_driver_8bit_palette_setup(GX_DISPLAY *display, VOID *aux_data,
70
                                               VOID (*toggle_function)(struct GX_CANVAS_STRUCT *canvas,
71
                                                                       GX_RECTANGLE *dirty_area))
72
{
73
    /* Default initiate and complete function to null for general condition. */
74
80
    display -> gx_display_driver_drawing_initiate              = GX_NULL;
75
80
    display -> gx_display_driver_drawing_complete              = GX_NULL;
76
77
#if defined(GX_MOUSE_SUPPORT)
78
#if defined(GX_HARDWARE_MOUSE_SUPPORT)
79
    display -> gx_display_mouse_position_set                   = GX_NULL;
80
    display -> gx_display_mouse_enable                         = GX_NULL;
81
#else
82
    display -> gx_display_mouse.gx_mouse_capture_memory        = (GX_UBYTE *)mouse_capture_memory;
83
    display -> gx_display_mouse.gx_mouse_status                = 0;
84
85
    display -> gx_display_mouse.gx_mouse_position.gx_point_x   = display -> gx_display_width / 2;
86
    display -> gx_display_mouse.gx_mouse_position.gx_point_y   = display -> gx_display_height / 2;
87
88
    /* these functions are specific to the display color format, and will be NULL for hardware mouse */
89
    display -> gx_display_mouse_capture                        = _gx_display_driver_8bpp_mouse_capture;
90
    display -> gx_display_mouse_restore                        = _gx_display_driver_8bpp_mouse_restore;
91
    display -> gx_display_mouse_draw                           = _gx_display_driver_generic_mouse_draw;
92
    display -> gx_display_driver_drawing_initiate              = _gx_display_driver_generic_drawing_initiate;
93
    display -> gx_display_driver_drawing_complete              = _gx_display_driver_generic_drawing_complete;
94
    display -> gx_display_mouse_position_set                   = _gx_display_driver_generic_mouse_position_set;
95
    display -> gx_display_mouse_enable                         = _gx_display_driver_generic_mouse_enable;
96
#endif
97
98
    /* these functions are generic, same for every color depth, but will be overridden for hardware mouse */
99
    display -> gx_display_mouse.gx_mouse_cursor_info           = GX_NULL;
100
    display -> gx_display_mouse_define                         = _gx_display_driver_generic_mouse_define;
101
#endif
102
103
80
    display -> gx_display_rotation_angle                       = 0;
104
80
    display -> gx_display_driver_data                          = (VOID *)aux_data;
105
80
    display -> gx_display_accelerator                          = GX_NULL;
106
80
    display -> gx_display_layer_services                       = GX_NULL;
107
80
    display -> gx_display_driver_callback_assign               = GX_NULL;
108
109
80
    display -> gx_display_color_format                         = GX_COLOR_FORMAT_8BIT_PALETTE;
110
80
    display -> gx_display_driver_canvas_copy                   = _gx_display_driver_8bpp_canvas_copy;
111
80
    display -> gx_display_driver_simple_line_draw              = _gx_display_driver_8bpp_simple_line_draw;
112
80
    display -> gx_display_driver_horizontal_line_draw          = _gx_display_driver_8bpp_horizontal_line_draw;
113
80
    display -> gx_display_driver_vertical_line_draw            = _gx_display_driver_8bpp_vertical_line_draw;
114
80
    display -> gx_display_driver_horizontal_pattern_line_draw  = _gx_display_driver_8bpp_horizontal_pattern_line_draw;
115
80
    display -> gx_display_driver_horizontal_pixelmap_line_draw = _gx_display_driver_8bpp_horizontal_pixelmap_line_draw;
116
80
    display -> gx_display_driver_vertical_pattern_line_draw    = _gx_display_driver_8bpp_vertical_pattern_line_draw;
117
80
    display -> gx_display_driver_pixel_write                   = _gx_display_driver_8bpp_pixel_write;
118
80
    display -> gx_display_driver_block_move                    = _gx_display_driver_8bpp_block_move;
119
120
80
    display -> gx_display_driver_native_color_get              = _gx_display_driver_8bit_palette_native_color_get;
121
80
    display -> gx_display_driver_row_pitch_get                 = _gx_display_driver_8bpp_row_pitch_get;
122
80
    display -> gx_display_driver_pixelmap_draw                 = _gx_display_driver_8bpp_pixelmap_draw;
123
80
    display -> gx_display_driver_pixelmap_rotate               = _gx_display_driver_8bpp_pixelmap_rotate;
124
80
    display -> gx_display_driver_alphamap_draw                 = GX_NULL;
125
80
    display -> gx_display_driver_simple_wide_line_draw         = _gx_display_driver_generic_simple_wide_line_draw;
126
80
    display -> gx_display_driver_polygon_draw                  = _gx_display_driver_generic_polygon_draw;
127
80
    display -> gx_display_driver_polygon_fill                  = _gx_display_driver_generic_polygon_fill;
128
129
80
    display -> gx_display_driver_anti_aliased_line_draw        = GX_NULL;
130
80
    display -> gx_display_driver_anti_aliased_wide_line_draw   = GX_NULL;
131
132
#if defined(GX_ARC_DRAWING_SUPPORT)
133
80
    display -> gx_display_driver_anti_aliased_circle_draw      = GX_NULL;
134
80
    display -> gx_display_driver_anti_aliased_ellipse_draw     = GX_NULL;
135
80
    display -> gx_display_driver_circle_draw                   = _gx_display_driver_generic_circle_draw;
136
80
    display -> gx_display_driver_circle_fill                   = _gx_display_driver_generic_circle_fill;
137
80
    display -> gx_display_driver_pie_fill                      = _gx_display_driver_generic_pie_fill;
138
80
    display -> gx_display_driver_anti_aliased_arc_draw         = GX_NULL;
139
80
    display -> gx_display_driver_arc_draw                      = _gx_display_driver_generic_arc_draw;
140
80
    display -> gx_display_driver_arc_fill                      = _gx_display_driver_generic_arc_fill;
141
80
    display -> gx_display_driver_ellipse_draw                  = _gx_display_driver_generic_ellipse_draw;
142
80
    display -> gx_display_driver_ellipse_fill                  = _gx_display_driver_generic_ellipse_fill;
143
80
    display -> gx_display_driver_anti_aliased_wide_circle_draw = GX_NULL;
144
80
    display -> gx_display_driver_wide_circle_draw              = _gx_display_driver_generic_wide_circle_draw;
145
80
    display -> gx_display_driver_anti_aliased_wide_ellipse_draw= GX_NULL;
146
80
    display -> gx_display_driver_wide_ellipse_draw             = _gx_display_driver_generic_wide_ellipse_draw;
147
80
    display -> gx_display_driver_anti_aliased_wide_arc_draw    = GX_NULL;
148
80
    display -> gx_display_driver_wide_arc_draw                 = _gx_display_driver_generic_wide_arc_draw;
149
#endif
150
151
80
    display -> gx_display_driver_palette_set                   = GX_NULL;
152
80
    display -> gx_display_driver_buffer_toggle                 = toggle_function;
153
154
80
    display -> gx_display_driver_canvas_blend                  = GX_NULL;
155
80
    display -> gx_display_driver_pixel_blend                   = GX_NULL;
156
80
    display -> gx_display_driver_pixelmap_blend                = GX_NULL;
157
158
#if(GX_PALETTE_MODE_AA_TEXT_COLORS == 8)
159
80
    display -> gx_display_driver_4bit_glyph_draw               = _gx_display_driver_8bpp_glyph_3bit_draw;
160
#else
161
    display -> gx_display_driver_4bit_glyph_draw               = _gx_display_driver_8bpp_glyph_4bit_draw;
162
#endif
163
80
    display -> gx_display_driver_1bit_glyph_draw               = _gx_display_driver_8bpp_glyph_1bit_draw;
164
165
#if defined(GX_SOFTWARE_DECODER_SUPPORT)
166
80
    display -> gx_display_driver_jpeg_draw                     = GX_NULL;
167
80
    display -> gx_display_driver_png_draw                      = GX_NULL;
168
#endif
169
80
}
170