1 /**
2  * @file lv_draw_sw.c
3  *
4  */
5 
6 /*********************
7  *      INCLUDES
8  *********************/
9 #include "../lv_draw.h"
10 #include "lv_draw_sw.h"
11 
12 /*********************
13  *      DEFINES
14  *********************/
15 
16 /**********************
17  *      TYPEDEFS
18  **********************/
19 
20 /**********************
21  *  STATIC PROTOTYPES
22  **********************/
23 
24 /**********************
25  *  GLOBAL PROTOTYPES
26  **********************/
27 
28 /**********************
29  *  STATIC VARIABLES
30  **********************/
31 
32 /**********************
33  *      MACROS
34  **********************/
35 
36 /**********************
37  *   GLOBAL FUNCTIONS
38  **********************/
39 
lv_draw_sw_init_ctx(lv_disp_drv_t * drv,lv_draw_ctx_t * draw_ctx)40 void lv_draw_sw_init_ctx(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx)
41 {
42     LV_UNUSED(drv);
43 
44     lv_draw_sw_ctx_t * draw_sw_ctx = (lv_draw_sw_ctx_t *) draw_ctx;
45     lv_memset_00(draw_sw_ctx, sizeof(lv_draw_sw_ctx_t));
46 
47     draw_sw_ctx->base_draw.draw_arc = lv_draw_sw_arc;
48     draw_sw_ctx->base_draw.draw_rect = lv_draw_sw_rect;
49     draw_sw_ctx->base_draw.draw_bg = lv_draw_sw_bg;
50     draw_sw_ctx->base_draw.draw_letter = lv_draw_sw_letter;
51     draw_sw_ctx->base_draw.draw_img_decoded = lv_draw_sw_img_decoded;
52     draw_sw_ctx->base_draw.draw_line = lv_draw_sw_line;
53     draw_sw_ctx->base_draw.draw_polygon = lv_draw_sw_polygon;
54     draw_sw_ctx->base_draw.wait_for_finish = lv_draw_sw_wait_for_finish;
55     draw_sw_ctx->blend = lv_draw_sw_blend_basic;
56 }
57 
lv_draw_sw_deinit_ctx(lv_disp_drv_t * drv,lv_draw_ctx_t * draw_ctx)58 void lv_draw_sw_deinit_ctx(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx)
59 {
60     LV_UNUSED(drv);
61 
62     lv_draw_sw_ctx_t * draw_sw_ctx = (lv_draw_sw_ctx_t *) draw_ctx;
63     lv_memset_00(draw_sw_ctx, sizeof(lv_draw_sw_ctx_t));
64 }
65 
lv_draw_sw_wait_for_finish(lv_draw_ctx_t * draw_ctx)66 void lv_draw_sw_wait_for_finish(lv_draw_ctx_t * draw_ctx)
67 {
68     LV_UNUSED(draw_ctx);
69     /*Nothing to wait for*/
70 }
71 
72 /**********************
73  *   STATIC FUNCTIONS
74  **********************/
75