GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_circular_gauge_needle_dirty_mark.c Lines: 6 6 100.0 %
Date: 2026-03-06 19:21:09 Branches: 0 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
/**   Circular Gauge Management (Circular Gauge)                          */
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_utility.h"
30
#include "gx_circular_gauge.h"
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_circular_gauge_needle_dirty_mark                PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function calculates current needle rectangle.                  */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    circular_gauge                        Circular gauge control block  */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    _gx_circular_gauge_needle_rectangle_calculate                       */
58
/*                                          Calculate the needle          */
59
/*                                            rectangle                   */
60
/*    _gx_system_dirty_partial_add          Add partial dirty area        */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*                                                                        */
66
/**************************************************************************/
67
1694
UINT  _gx_circular_gauge_needle_dirty_mark(GX_CIRCULAR_GAUGE *gauge)
68
{
69
GX_RECTANGLE            dirty_rect;
70
71
    /* Get last needle rectangle. */
72
1694
    dirty_rect = gauge -> gx_circular_gauge_current_needle_rectangle;
73
74
    /*Caculate the new needle rectangle. */
75
1694
    _gx_circular_gauge_needle_rectangle_calculate(gauge, gauge->gx_circular_gauge_current_angle, &(gauge->gx_circular_gauge_current_needle_rectangle));
76
77
    /* Combine last and current needle rectangle.  */
78
1694
    _gx_utility_rectangle_combine(&dirty_rect, &(gauge->gx_circular_gauge_current_needle_rectangle));
79
80
    /* Mark the combine area as dirty.  */
81
1694
    _gx_system_dirty_partial_add((GX_WIDGET *)gauge, &dirty_rect);
82
83
1694
    return(GX_SUCCESS);
84
}
85