feat(draw): Optimize struct alignment (#8409)
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled

This commit is contained in:
Fabian Blatz
2025-06-10 21:40:04 +02:00
committed by GitHub
parent f512bda660
commit 9cfa7d3f64
5 changed files with 51 additions and 41 deletions
+24 -20
View File
@@ -73,15 +73,26 @@ typedef enum {
} lv_draw_task_state_t;
struct _lv_layer_t {
/** Target draw buffer of the layer*/
/** Target draw buffer of the layer */
lv_draw_buf_t * draw_buf;
/** Linked list of draw tasks */
lv_draw_task_t * draw_task_head;
/** Parent layer */
lv_layer_t * parent;
/** Next layer */
lv_layer_t * next;
/** User data */
void * user_data;
/** The absolute coordinates of the buffer */
lv_area_t buf_area;
/** The color format of the layer. LV_COLOR_FORMAT_... */
lv_color_format_t color_format;
/** The physical clipping area relative to the display */
lv_area_t phy_clip_area;
/**
* NEVER USE IT DRAW UNITS. USED INTERNALLY DURING DRAW TASK CREATION.
@@ -93,32 +104,25 @@ struct _lv_layer_t {
*/
lv_area_t _clip_area;
/**
* The physical clipping area relative to the display.
*/
lv_area_t phy_clip_area;
#if LV_DRAW_TRANSFORM_USE_MATRIX
/** Transform matrix to be applied when rendering the layer */
lv_matrix_t matrix;
#endif
/** Opacity of the layer */
lv_opa_t opa;
/*Recolor of the layer*/
lv_color32_t recolor;
/** Partial y offset */
int32_t partial_y_offset;
/** Linked list of draw tasks */
lv_draw_task_t * draw_task_head;
/** Recolor of the layer */
lv_color32_t recolor;
lv_layer_t * parent;
lv_layer_t * next;
/** The color format of the layer. LV_COLOR_FORMAT_... */
lv_color_format_t color_format;
/** Flag indicating all tasks are added */
bool all_tasks_added;
void * user_data;
/** Opacity of the layer */
lv_opa_t opa;
};
typedef struct {
+3 -3
View File
@@ -45,12 +45,12 @@ typedef struct {
/**The center point of the arc. */
lv_point_t center;
/**The outer radius of the arc*/
uint16_t radius;
/**An image source to be used instead of `color`. `NULL` if unused*/
const void * img_src;
/**The outer radius of the arc*/
uint16_t radius;
/**Opacity of the arc in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
+7 -5
View File
@@ -74,16 +74,19 @@ typedef struct {
/**The number of characters to render. 0: means render until reaching the `\0` termination.*/
uint32_t text_length;
/**Opacity of the text in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**The alignment of the text `LV_TEXT_ALIGN_LEFT/RIGHT/CENTER`*/
lv_text_align_t align;
/**The base direction. Used when type setting Right-to-left (e.g. Arabic) texts*/
lv_base_dir_t bidi_dir;
/**Opacity of the text in 0...255 range.
* LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/
lv_opa_t opa;
/**Letter outline stroke opacity */
lv_opa_t outline_stroke_opa;
/**Text decoration, e.g. underline*/
lv_text_decor_t decor : 3;
@@ -105,7 +108,6 @@ typedef struct {
lv_draw_label_hint_t * hint;
/* Properties of the letter outlines */
lv_opa_t outline_stroke_opa;
lv_color_t outline_stroke_color;
int32_t outline_stroke_width;
+12 -8
View File
@@ -33,11 +33,6 @@ typedef struct {
int32_t radius;
/*Background*/
lv_opa_t bg_opa;
lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/
lv_grad_dsc_t bg_grad;
/*Background img*/
const void * bg_image_src;
const void * bg_image_symbol_font;
@@ -45,11 +40,22 @@ typedef struct {
lv_opa_t bg_image_opa;
lv_opa_t bg_image_recolor_opa;
uint8_t bg_image_tiled;
/*Background*/
lv_opa_t bg_opa;
/*Border*/
lv_opa_t border_opa;
/*Outline */
lv_opa_t outline_opa;
/*Shadow*/
lv_opa_t shadow_opa;
/*Background*/
lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/
lv_grad_dsc_t bg_grad;
/*Border*/
lv_color_t border_color;
int32_t border_width;
lv_opa_t border_opa;
lv_border_side_t border_side : 5;
uint8_t border_post : 1; /*The border will be drawn later*/
@@ -57,7 +63,6 @@ typedef struct {
lv_color_t outline_color;
int32_t outline_width;
int32_t outline_pad;
lv_opa_t outline_opa;
/*Shadow*/
lv_color_t shadow_color;
@@ -65,7 +70,6 @@ typedef struct {
int32_t shadow_offset_x;
int32_t shadow_offset_y;
int32_t shadow_spread;
lv_opa_t shadow_opa;
} lv_draw_rect_dsc_t;
typedef struct {
+5 -5
View File
@@ -61,17 +61,17 @@ typedef enum {
/** Data structure passed to an input driver to fill*/
typedef struct {
lv_indev_gesture_type_t gesture_type[LV_INDEV_GESTURE_CNT]; /* Current gesture types, per gesture */
void * gesture_data[LV_INDEV_GESTURE_CNT]; /* Used to store data per gesture */
lv_indev_state_t state; /**< LV_INDEV_STATE_RELEASED or LV_INDEV_STATE_PRESSED*/
lv_point_t point; /**< For LV_INDEV_TYPE_POINTER the currently pressed point*/
uint32_t key; /**< For LV_INDEV_TYPE_KEYPAD the currently pressed key*/
uint32_t btn_id; /**< For LV_INDEV_TYPE_BUTTON the currently pressed button*/
int16_t enc_diff; /**< For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/
lv_indev_state_t state; /**< LV_INDEV_STATE_RELEASED or LV_INDEV_STATE_PRESSED*/
bool continue_reading; /**< If set to true, the read callback is invoked again, unless the device is in event-driven mode*/
lv_indev_gesture_type_t gesture_type[LV_INDEV_GESTURE_CNT]; /* Current gesture types, per gesture */
void * gesture_data[LV_INDEV_GESTURE_CNT]; /* Used to store data per gesture */
} lv_indev_data_t;
typedef void (*lv_indev_read_cb_t)(lv_indev_t * indev, lv_indev_data_t * data);