| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef LV_DRAW_DAVE2D_H |
| 7 |
#define LV_DRAW_DAVE2D_H |
| 8 |
|
| 9 |
#ifdef __cplusplus |
| 10 |
extern "C" { |
| 11 |
#endif |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include "../../../lv_conf_internal.h" |
| 17 |
#if LV_USE_DRAW_DAVE2D |
| 18 |
#include "../../lv_draw.h" |
| 19 |
#include "../../lv_draw_private.h" |
| 20 |
#include "bsp_api.h" |
| 21 |
#include "dave_driver.h" |
| 22 |
|
| 23 |
#if LV_USE_FLOAT |
| 24 |
|
| 25 |
|
| 26 |
#undef D2_FIX4 |
| 27 |
#undef D2_INT4 |
| 28 |
#undef D2_FLOOR4 |
| 29 |
#undef D2_CEIL4 |
| 30 |
#undef D2_FRAC4 |
| 31 |
#undef D2_FIX16 |
| 32 |
#undef D2_INT16 |
| 33 |
#undef D2_FLOOR16 |
| 34 |
#undef D2_CEIL16 |
| 35 |
#undef D2_FRAC16 |
| 36 |
|
| 37 |
#define D2_FIX4(x) (((int32_t)(x)) << 4) |
| 38 |
#define D2_INT4(x) (((int32_t)(x))(x) >> 4) |
| 39 |
#define D2_FLOOR4(x) (((int32_t)(x))((d2_u32)(x)) & ~15u) |
| 40 |
#define D2_CEIL4(x) ((((d2_u32)(x)) + 15u) & ~15u) |
| 41 |
#define D2_FRAC4(x) (((d2_u32)(x)) & 15u) |
| 42 |
#define D2_FIX16(x) (((int32_t)(x)) << 16) |
| 43 |
#define D2_INT16(x) (((int32_t)(x)) >> 16) |
| 44 |
#define D2_FLOOR16(x) (((d2_u32)(x)) & ~65535u) |
| 45 |
#define D2_CEIL16(x) ((((d2_u32)(x)) + 65535u) & ~65535u) |
| 46 |
#define D2_FRAC16(x) (((d2_u32)(x)) & 65535u) |
| 47 |
|
| 48 |
|
| 49 |
#endif |
| 50 |
|
| 51 |
#include "lv_draw_dave2d_utils.h" |
| 52 |
#include "../../lv_draw_rect.h" |
| 53 |
#include "../../lv_draw_line.h" |
| 54 |
#include "../../lv_draw_arc.h" |
| 55 |
#include "../../lv_draw_label.h" |
| 56 |
#include "../../lv_draw_image.h" |
| 57 |
#include "../../lv_draw_triangle.h" |
| 58 |
#include "../../lv_draw_buf.h" |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
typedef struct { |
| 71 |
lv_draw_unit_t base_unit; |
| 72 |
lv_draw_task_t * task_act; |
| 73 |
#if LV_USE_OS |
| 74 |
lv_thread_sync_t sync; |
| 75 |
lv_thread_t thread; |
| 76 |
#endif |
| 77 |
uint32_t idx; |
| 78 |
d2_device * d2_handle; |
| 79 |
d2_renderbuffer * renderbuffer; |
| 80 |
d2_renderbuffer * label_renderbuffer; |
| 81 |
|
| 82 |
#if LV_USE_OS |
| 83 |
lv_mutex_t * pd2Mutex; |
| 84 |
#endif |
| 85 |
} lv_draw_dave2d_unit_t; |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
void lv_draw_dave2d_init(void); |
| 92 |
|
| 93 |
void lv_draw_dave2d_image(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc, |
| 94 |
const lv_area_t * coords); |
| 95 |
|
| 96 |
void lv_draw_dave2d_fill(lv_draw_task_t * t, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords); |
| 97 |
|
| 98 |
void lv_draw_dave2d_border(lv_draw_task_t * t, const lv_draw_border_dsc_t * dsc, |
| 99 |
const lv_area_t * coords); |
| 100 |
|
| 101 |
void lv_draw_dave2d_box_shadow(lv_draw_task_t * t, const lv_draw_box_shadow_dsc_t * dsc, |
| 102 |
const lv_area_t * coords); |
| 103 |
|
| 104 |
void lv_draw_dave2d_label(lv_draw_task_t * t, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords); |
| 105 |
|
| 106 |
void lv_draw_dave2d_arc(lv_draw_task_t * t, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords); |
| 107 |
|
| 108 |
void lv_draw_dave2d_line(lv_draw_task_t * t, const lv_draw_line_dsc_t * dsc); |
| 109 |
|
| 110 |
void lv_draw_dave2d_layer(lv_draw_task_t * t, const lv_draw_image_dsc_t * draw_dsc, |
| 111 |
const lv_area_t * coords); |
| 112 |
|
| 113 |
void lv_draw_dave2d_triangle(lv_draw_task_t * t, const lv_draw_triangle_dsc_t * dsc); |
| 114 |
|
| 115 |
void lv_draw_dave2d_mask_rect(lv_draw_task_t * t, const lv_draw_mask_rect_dsc_t * dsc, |
| 116 |
const lv_area_t * coords); |
| 117 |
|
| 118 |
void lv_draw_dave2d_transform(lv_draw_task_t * t, const lv_area_t * dest_area, const void * src_buf, |
| 119 |
int32_t src_w, int32_t src_h, int32_t src_stride, |
| 120 |
const lv_draw_image_dsc_t * draw_dsc, const lv_draw_image_sup_t * sup, lv_color_format_t cf, void * dest_buf); |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
#endif |
| 131 |
|
| 132 |
#ifdef __cplusplus |
| 133 |
} |
| 134 |
#endif |
| 135 |
|
| 136 |
#endif |