GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_24xrgb_png_draw.c Lines: 7 7 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_context.h"
29
#include "gx_system.h"
30
#include "gx_display.h"
31
#include "gx_image_reader.h"
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_display_driver_24xrgb_png_draw                  PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    24xrgb format screen driver PNG drawing function.                   */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    context                               Drawing context               */
50
/*    xpos                                  x-coord of top-left draw point*/
51
/*    ypos                                  y-coord of top-left draw point*/
52
/*    pixelmap                              Pointer to GX_PIXELMAP struct */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    None                                                                */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_image_reader_create                                             */
61
/*    _gx_image_reader_start                                              */
62
/*    _gx_display_driver_24xrgb_pixelmap_draw                             */
63
/*    _gx_system_memory_free                                              */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*    GUIX Internal Code                                                  */
69
/*                                                                        */
70
/**************************************************************************/
71
#if defined(GX_SOFTWARE_DECODER_SUPPORT)
72
201
VOID _gx_display_driver_24xrgb_png_draw(GX_DRAW_CONTEXT *context, INT xpos, INT ypos, GX_PIXELMAP *pixelmap)
73
{
74
GX_IMAGE_READER image_reader;
75
GX_PIXELMAP     pic_outmap;
76
77
201
    _gx_image_reader_create(&image_reader,
78
                            pixelmap -> gx_pixelmap_data,
79
201
                            (INT)pixelmap -> gx_pixelmap_data_size,
80
                            GX_COLOR_FORMAT_24XRGB, GX_IMAGE_READER_MODE_ALPHA);
81
82
201
    if (_gx_image_reader_start(&image_reader, &pic_outmap) == GX_SUCCESS)
83
    {
84
134
        _gx_display_driver_24xrgb_pixelmap_draw(context, xpos, ypos, &pic_outmap);
85
86
134
        _gx_system_memory_free((VOID *)pic_outmap.gx_pixelmap_data);
87
    }
88
201
}
89
#endif
90