GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_context_pixelmap_get.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 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
/**   Context Management (Context)                                        */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_context.h"
30
31
/* Bring in externs for caller checking code.  */
32
GX_CALLER_CHECKING_EXTERNS
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_context_pixelmap_get                           PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function checks for errors in context pixelmap set call.       */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    pixelmap_id                           Pixelmap resource ID          */
51
/*    return_pixelmap                       Pointer to pixelmap           */
52
/*                                            destination pointer         */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    status                                Completion status             */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_context_pixelmap_get              Actual context pixelmap get   */
61
/*                                            call                        */
62
/*                                                                        */
63
/*  CALLED BY                                                             */
64
/*                                                                        */
65
/*    Application Code                                                    */
66
/*    GUIX default draw funtions                                          */
67
/*                                                                        */
68
/**************************************************************************/
69
28642
UINT _gxe_context_pixelmap_get(GX_RESOURCE_ID pixelmap_id, GX_PIXELMAP **return_pixelmap)
70
{
71
UINT             status;
72
73
    /* Check for invalid pointer.  */
74
28642
    if (return_pixelmap == GX_NULL)
75
    {
76
2
        return(GX_PTR_ERROR);
77
    }
78
79
28640
    if (_gx_system_current_draw_context == GX_NULL)
80
    {
81
1
        *return_pixelmap = GX_NULL;
82
1
        return GX_INVALID_CONTEXT;
83
    }
84
85
    /* Call actual pixelmap.  */
86
28639
    status = _gx_context_pixelmap_get(pixelmap_id, return_pixelmap);
87
88
    /* Return status.  */
89
28639
    return(status);
90
}
91