GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_vertical_line_alpha_draw.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 6 6 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
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_display.h"
28
29
#if defined GX_BRUSH_ALPHA_SUPPORT
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_display_driver_vertical_line_alpha_draw         PORTABLE C      */
35
/*                                                           6.1          */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION                                                           */
41
/*                                                                        */
42
/*    Generic driver function that handles drawing vertical line with     */
43
/*    brush alpha.                                                        */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    context                               Drawing context               */
48
/*    ystart                                y-coord of top endpoint       */
49
/*    yend                                  y-coord of bottom endpoint    */
50
/*    xpos                                  x-coord of left edge          */
51
/*    width                                 width of the line             */
52
/*    color                                 Color of line to write        */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    None                                                                */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    [gx_display_driver_pixel_blend]       Basic display driver pixel    */
61
/*                                            blend function              */
62
/*                                                                        */
63
/*  CALLED BY                                                             */
64
/*                                                                        */
65
/*    _gx_display_driver_32bpp_vertical_line_alpha_draw                   */
66
/*    _gx_display_driver_16bpp_vertical_line_alpha_draw                   */
67
/*    _gx_display_driver_8bpp_vertical_line_alpha_draw                    */
68
/*                                                                        */
69
/**************************************************************************/
70
144959
VOID _gx_display_driver_vertical_line_alpha_draw(GX_DRAW_CONTEXT *context, INT ystart, INT yend, INT xpos, INT width, GX_COLOR color, GX_UBYTE alpha)
71
{
72
INT     xval;
73
INT     yval;
74
INT     xend;
75
VOID  (*blend_func)(GX_DRAW_CONTEXT *context, INT x, INT y, GX_COLOR fcolor, GX_UBYTE alpha);
76
77
144959
    blend_func = context -> gx_draw_context_display -> gx_display_driver_pixel_blend;
78
79
144959
    if (blend_func == GX_NULL)
80
    {
81
48
        return;
82
    }
83
84
144911
    xend = xpos + width;
85
    /* draw line from top to bottom */
86
6153355
    for (yval = ystart; yval <= yend; yval++)
87
    {
88
        /* draw line width from left to right */
89
12255947
        for (xval = xpos; xval < xend; xval++)
90
        {
91
6247503
            blend_func(context, xval, yval, color, alpha);
92
        }
93
    }
94
}
95
96
#endif