GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_8bpp_rotated_horizontal_line_draw.c Lines: 14 14 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
/* Include necessary system files.  */
23
24
#include "gx_api.h"
25
#include "gx_display.h"
26
27
/**************************************************************************/
28
/*                                                                        */
29
/*  FUNCTION                                               RELEASE        */
30
/*                                                                        */
31
/*    _gx_display_driver_8bpp_rotated_horizontal_line_draw                */
32
/*                                                        PORTABLE C      */
33
/*                                                           6.1.4        */
34
/*  AUTHOR                                                                */
35
/*                                                                        */
36
/*    Kenneth Maxwell, Microsoft Corporation                              */
37
/*                                                                        */
38
/*  DESCRIPTION                                                           */
39
/*                                                                        */
40
/*    Generic 8bpp color format rotated horizontal line draw function.    */
41
/*                                                                        */
42
/*  INPUT                                                                 */
43
/*                                                                        */
44
/*    context                               Drawing context               */
45
/*    xstart                                x-coord of left endpoint      */
46
/*    xend                                  x-coord of right endpoint     */
47
/*    ypos                                  y-coord of line top           */
48
/*    width                                 Width (height) of the line    */
49
/*    color                                 Color of line to write        */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    NOne                                                                */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    None                                                                */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    GUIX Internal Code                                                  */
62
/*                                                                        */
63
/**************************************************************************/
64
175073
VOID _gx_display_driver_8bpp_rotated_horizontal_line_draw(GX_DRAW_CONTEXT *context, INT xstart, INT xend, INT ypos, INT width, GX_COLOR color)
65
{
66
INT       row;
67
INT       column;
68
GX_UBYTE *put;
69
GX_UBYTE *rowstart;
70
175073
INT       len = xend - xstart + 1;
71
72
    /* Pick up start address of canvas memory.  */
73
175073
    rowstart = (GX_UBYTE *)context -> gx_draw_context_memory;
74
75
    /* Calculate start of row address.  */
76
175073
    if (context -> gx_draw_context_display -> gx_display_rotation_angle == GX_SCREEN_ROTATION_CW)
77
    {
78
89706
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_x_resolution - xstart - 1) * context -> gx_draw_context_pitch;
79
89706
        rowstart += ypos;
80
    }
81
    else
82
    {
83
85367
        rowstart += xend * context -> gx_draw_context_pitch;
84
85367
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_y_resolution - ypos - width);
85
    }
86
87
    /* Draw one line, left to right.  */
88
21327126
    for (column = 0; column < len; column++)
89
    {
90
21152053
        put = rowstart;
91
92
        /* Draw pixel to fill width.  */
93
2107279264
        for (row = 0; row < width; row++)
94
        {
95
2086127211
            *put++ = (GX_UBYTE)color;
96
        }
97
21152053
        rowstart -= context -> gx_draw_context_pitch;
98
    }
99
175073
}
100