/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** GUIX Component */ /** */ /** Canvas Management (Canvas) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" #include "gx_utility.h" #include "gx_canvas.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_canvas_alpha_set PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function assigns the alpha-blend value of a canvas */ /* */ /* INPUT */ /* */ /* canvas Canvas control block */ /* alpha alpha value */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _gx_canvas_dirty_mark Set the canvas dirty flag */ /* */ /* CALLED BY */ /* */ /* _gx_animation_start */ /* _gx_animation_update */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _gx_canvas_alpha_set(GX_CANVAS *canvas, GX_UBYTE alpha) { VOID (*alpha_set)(INT layer, GX_UBYTE alpha); /* change the alpha value */ canvas -> gx_canvas_alpha = alpha; if (canvas -> gx_canvas_hardware_layer >= 0) { alpha_set = canvas -> gx_canvas_display -> gx_display_layer_services -> gx_display_layer_alpha_set; if (alpha_set) { alpha_set(canvas -> gx_canvas_hardware_layer, alpha); return(GX_SUCCESS); } } /* mark the canvas dirty so that it get refreshed */ _gx_canvas_dirty_mark(canvas, GX_NULL); /* Return successful status. */ return(GX_SUCCESS); }