GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_canvas_show.c Lines: 9 9 100.0 %
Date: 2024-12-05 08:52:37 Branches: 4 4 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   Canvas Management (Canvas)                                          */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_system.h"
28
#include "gx_utility.h"
29
#include "gx_canvas.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_canvas_show                                     PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function makes a canvas visible                                */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    canvas                                Canvas control block          */
49
/*                                                                        */
50
/*  OUTPUT                                                                */
51
/*                                                                        */
52
/*    status                                Completion status             */
53
/*                                                                        */
54
/*  CALLS                                                                 */
55
/*                                                                        */
56
/*    _gx_canvas_dirty_mark                 Set the canvas dirty flag     */
57
/*                                                                        */
58
/*  CALLED BY                                                             */
59
/*                                                                        */
60
/*    Application                                                         */
61
/*                                                                        */
62
/*  RELEASE HISTORY                                                       */
63
/*                                                                        */
64
/*    DATE              NAME                      DESCRIPTION             */
65
/*                                                                        */
66
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
67
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
68
/*                                            resulting in version 6.1    */
69
/*                                                                        */
70
/**************************************************************************/
71
46
UINT  _gx_canvas_show(GX_CANVAS *canvas)
72
{
73
VOID (*show_function)(INT layer);
74
75
    /* change the alpha value */
76
46
    canvas -> gx_canvas_status |= GX_CANVAS_VISIBLE;
77
78
46
    if (canvas -> gx_canvas_hardware_layer >= 0)
79
    {
80
2
        show_function = canvas -> gx_canvas_display -> gx_display_layer_services -> gx_display_layer_show;
81
82
2
        if (show_function)
83
        {
84
1
            show_function(canvas -> gx_canvas_hardware_layer);
85
1
            return(GX_SUCCESS);
86
        }
87
    }
88
89
    /* mark the canvas dirty so that it get refreshed */
90
45
    _gx_canvas_dirty_mark(canvas, GX_NULL);
91
92
    /* Return successful status.  */
93
45
    return(GX_SUCCESS);
94
}
95