GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_8bpp_rotated_vertical_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
23
/* Include necessary system files.  */
24
25
#include "gx_api.h"
26
#include "gx_display.h"
27
28
/**************************************************************************/
29
/*                                                                        */
30
/*  FUNCTION                                               RELEASE        */
31
/*                                                                        */
32
/*    _gx_display_driver_8bpp_rotated_vertical_line_draw  PORTABLE C      */
33
/*                                                           6.1.4        */
34
/*  AUTHOR                                                                */
35
/*                                                                        */
36
/*    Kenneth Maxwell, Microsoft Corporation                              */
37
/*                                                                        */
38
/*  DESCRIPTION                                                           */
39
/*                                                                        */
40
/*    Generic 8bpp color format rotated vertical line draw function.      */
41
/*                                                                        */
42
/*  INPUT                                                                 */
43
/*                                                                        */
44
/*    context                               Drawing context               */
45
/*    ystart                                y-coord of top endpoint       */
46
/*    yend                                  y-coord of bottom endpoint    */
47
/*    xpos                                  x-coord of left edge          */
48
/*    width                                 width of the line             */
49
/*    color                                 Color of line to draw         */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    None                                                                */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    None                                                                */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    GUIX Internal Code                                                  */
62
/*                                                                        */
63
/**************************************************************************/
64
278415
VOID _gx_display_driver_8bpp_rotated_vertical_line_draw(GX_DRAW_CONTEXT *context, INT ystart, INT yend, INT xpos, INT width, GX_COLOR color)
65
{
66
INT       row;
67
INT       column;
68
GX_UBYTE *put;
69
GX_UBYTE *rowstart;
70
278415
INT       len = yend - ystart + 1;
71
72
    /* Pick up starting address of canvas memory.  */
73
278415
    rowstart = (GX_UBYTE *)context -> gx_draw_context_memory;
74
75
278415
    if (context -> gx_draw_context_display -> gx_display_rotation_angle == GX_SCREEN_ROTATION_CW)
76
    {
77
        /* Calculate start of scanline.  */
78
141543
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_x_resolution - xpos - 1) * context -> gx_draw_context_pitch;
79
80
        /* Offset into starting pixel.  */
81
141543
        rowstart += ystart;
82
    }
83
    else
84
    {
85
136872
        rowstart += (xpos + width - 1) * context -> gx_draw_context_pitch;
86
136872
        rowstart += (context -> gx_draw_context_canvas -> gx_canvas_y_resolution - yend - 1);
87
    }
88
89
    /* Draw line width from left to right.  */
90
558832
    for (column = 0; column < width; column++)
91
    {
92
280417
        put = rowstart;
93
94
        /* Draw line from top to bottom.  */
95
12665227
        for (row = 0; row < len; row++)
96
        {
97
12384810
            *put++ = (GX_UBYTE)color;
98
        }
99
100
        /* Ddvance to the next scaneline.  */
101
280417
        rowstart -= context -> gx_draw_context_pitch;
102
    }
103
278415
}
104