GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_16bpp_rotated_pixel_write.c Lines: 9 9 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 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_16bpp_rotated_pixel_write        PORTABLE C      */
35
/*                                                           6.1.3        */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION                                                           */
41
/*                                                                        */
42
/*    Generic 16bpp color format pixel write function.                    */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    context                               Drawing context               */
47
/*    x                                     X coordinate                  */
48
/*    y                                     Y coordinate                  */
49
/*    color                                 Color of pixel 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
522623
VOID _gx_display_driver_16bpp_rotated_pixel_write(GX_DRAW_CONTEXT *context, INT x, INT y, GX_COLOR color)
65
{
66
522623
USHORT *put = (USHORT *)context -> gx_draw_context_memory;
67
68
    /* Calculate address of scan line.  */
69
522623
    if (context -> gx_draw_context_display -> gx_display_rotation_angle == GX_SCREEN_ROTATION_CW)
70
    {
71
268800
        put += context -> gx_draw_context_pitch * (context -> gx_draw_context_canvas -> gx_canvas_x_resolution - x - 1);
72
73
        /* Step in by y coordinate.  */
74
268800
        put += y;
75
    }
76
    else
77
    {
78
253823
        put += context -> gx_draw_context_pitch * x;
79
80
        /* Step in by y coordinate.  */
81
253823
        put += (context -> gx_draw_context_canvas -> gx_canvas_y_resolution - y - 1);
82
    }
83
84
    /* Write the pixel value.  */
85
522623
    *put = (USHORT)color;
86
522623
}
87