1 /**
2  * MIT License
3  *
4  * -----------------------------------------------------------------------------
5  * Copyright (c) 2008-24 Think Silicon Single Member PC
6  * -----------------------------------------------------------------------------
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a copy
9  * of this software and associated documentation files (the "Software"), to deal
10  * in the Software without restriction, including without limitation the rights to
11  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12  * the Software, and to permit persons to whom the Software is furnished to do so,
13  * subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice (including the next paragraph)
16  * shall be included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
23  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  */
26 
27 /**
28  * @file lv_draw_nema_gfx_fill.c
29  *
30  */
31 
32 /*********************
33  *      INCLUDES
34  *********************/
35 #include "lv_draw_nema_gfx.h"
36 
37 #if LV_USE_NEMA_GFX
38 
39 /**********************
40  *   GLOBAL FUNCTIONS
41  **********************/
42 
lv_draw_nema_gfx_layer(lv_draw_unit_t * draw_unit,const lv_draw_image_dsc_t * draw_dsc,const lv_area_t * coords)43 void lv_draw_nema_gfx_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * coords)
44 {
45     lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src;
46 
47     /*It can happen that nothing was draw on a layer and therefore its buffer is not allocated.
48      *In this case just return. */
49     if(layer_to_draw->draw_buf == NULL) return;
50 
51     lv_draw_image_dsc_t new_draw_dsc = *draw_dsc;
52     new_draw_dsc.src = layer_to_draw->draw_buf;
53 
54     lv_draw_nema_gfx_img(draw_unit, &new_draw_dsc, coords);
55 }
56 
57 #endif /*LV_USE_NEMA_GFX*/
58