GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_16bpp_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
23
#define GX_SOURCE_CODE
24
25
26
/* Include necessary system files.  */
27
28
#include "gx_api.h"
29
#include "gx_display.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_display_driver_16bpp_rotated_horizontal_line_draw PORTABLE C    */
36
/*                                                           6.1.3        */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    Generic 16bpp 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
/*                                          Display driver basic          */
62
/*                                            horiztonal alpha line draw  */
63
/*                                            route                       */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    GUIX Internal Code                                                  */
68
/*                                                                        */
69
/**************************************************************************/
70
301128
VOID _gx_display_driver_16bpp_rotated_horizontal_line_draw(GX_DRAW_CONTEXT *context, INT xstart, INT xend, INT ypos, INT width, GX_COLOR color)
71
{
72
#if 1
73
INT     row;
74
INT     column;
75
USHORT *put;
76
USHORT *rowstart;
77
301128
INT     len = xend - xstart + 1;
78
79
#if defined GX_BRUSH_ALPHA_SUPPORT
80
GX_UBYTE alpha;
81
82
301128
    alpha = context -> gx_draw_context_brush.gx_brush_alpha;
83
301128
    if (alpha == 0)
84
    {
85
        /* Nothing to drawn. Just return. */
86
6
        return;
87
    }
88
89
301122
    if (alpha != 0xff)
90
    {
91
6
        _gx_display_driver_horizontal_line_alpha_draw(context, xstart, xend, ypos, width, color, alpha);
92
6
        return;
93
    }
94
#endif
95
96
    /* pick up start address of canvas memory */
97
301116
    rowstart = (USHORT *)context -> gx_draw_context_memory;
98
99
    /* calculate start of row address */
100
301116
    if (context -> gx_draw_context_display -> gx_display_rotation_angle == GX_SCREEN_ROTATION_CW)
101
    {
102
169239
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_x_resolution - xstart - 1) * context -> gx_draw_context_pitch;
103
169239
        rowstart += ypos;
104
    }
105
    else
106
    {
107
131877
        rowstart += xend * context -> gx_draw_context_pitch;
108
131877
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_y_resolution - ypos - width);
109
    }
110
111
112
    /* draw one line, left to right */
113
30666330
    for (column = 0; column < len; column++)
114
    {
115
30365214
        put = rowstart;
116
117
        /* draw lines to fill width */
118
2623588890
        for (row = 0; row < width; row++)
119
        {
120
2593223676
            *put++ = (USHORT)color;
121
        }
122
123
30365214
        rowstart -= context->gx_draw_context_pitch;
124
    }
125
#endif
126
}
127