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

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
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
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_display.h"
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_display_driver_32bpp_rotated_horizontal_line_draw               */
35
/*                                                        PORTABLE C      */
36
/*                                                           6.1.4        */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    Generic 32bpp color format horizontal line draw function.           */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    context                               Drawing context               */
48
/*    xstart                                x-coord of left endpoint      */
49
/*    xend                                  x-coord of right endpoint     */
50
/*    ypos                                  y-coord of line top           */
51
/*    width                                 Width (height) of the line    */
52
/*    color                                 Color of line to write        */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    NOne                                                                */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_display_driver_horizontal_line_alpha_draw                       */
61
/*                                          Basic horizontal line alpha   */
62
/*                                            draw function               */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    GUIX Internal Code                                                  */
67
/*                                                                        */
68
/**************************************************************************/
69
416035
VOID _gx_display_driver_32bpp_rotated_horizontal_line_draw(GX_DRAW_CONTEXT *context, INT xstart, INT xend, INT ypos, INT width, GX_COLOR color)
70
{
71
INT    row;
72
INT    column;
73
ULONG *put;
74
ULONG *rowstart;
75
416035
INT    len = xend - xstart + 1;
76
77
#if defined GX_BRUSH_ALPHA_SUPPORT
78
GX_UBYTE alpha;
79
80
416035
    alpha = context -> gx_draw_context_brush.gx_brush_alpha;
81
416035
    if (alpha == 0)
82
    {
83
        /* Nothing to drawn. Just return.  */
84
17
        return;
85
    }
86
87
416018
    if (alpha != 0xff)
88
    {
89
87
        _gx_display_driver_horizontal_line_alpha_draw(context, xstart, xend, ypos, width, color, alpha);
90
87
        return;
91
    }
92
#endif
93
94
    /* Pick up start address of canvas memory.  */
95
415931
    rowstart = (ULONG *)context -> gx_draw_context_memory;
96
97
    /* Calculate start of row address.  */
98
415931
    if (context -> gx_draw_context_display -> gx_display_rotation_angle == GX_SCREEN_ROTATION_CW)
99
    {
100
273436
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_x_resolution - xstart - 1) * context -> gx_draw_context_pitch;
101
273436
        rowstart += ypos;
102
    }
103
    else
104
    {
105
142495
        rowstart += xend * context -> gx_draw_context_pitch;
106
142495
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_y_resolution - ypos - width);
107
    }
108
109
    /* Draw one line, left to right.  */
110
43577836
    for (column = 0; column < len; column++)
111
    {
112
43161905
        put = rowstart;
113
114
        /* Draw 1-pixel vertical lines to fill width.  */
115
3718341715
        for (row = 0; row < width; row++)
116
        {
117
3675179810
            *put++ = (ULONG)color;
118
        }
119
120
43161905
        rowstart -= context -> gx_draw_context_pitch;
121
    }
122
}
123