Skip to content

Conversation

@XuNeo
Copy link
Collaborator

@XuNeo XuNeo commented Jan 26, 2024

Description of the feature or fix

Based on #5487 Fix #5054
lv_image_dsc_t should only by used to describe a constant image
resource.

lv_draw_buf_t is used to describe an image in RAM.

lv_image_buf.c/.h is now removed.

Notes

@XuNeo XuNeo requested review from FASTSHIFT and kisvegabor and removed request for kisvegabor January 27, 2024 09:43
@XuNeo XuNeo force-pushed the const-lv-image-dsc branch 2 times, most recently from 7a0539d to c65883e Compare January 30, 2024 14:38
@XuNeo XuNeo changed the title feat(draw_buf): make lv_image_dsc_t constant only feat(draw_buf): distinguish between lv_image_dsc_t and lv_draw_buf_t Jan 30, 2024
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me we have types and functions for

  • draw_buf only: the manage modifiable buffers
  • images only: e.g. lv_image_dsc_t
  • both: LV_IMAGE_FLAG_...

I'm not sure if we need any distinction between images and draw buffer except the LV_IMAGE_FLAGS_MODIFIABLE flag.

Of course, we need some backward compatibility layer in the core LVGL, but I would keep only draw_buf.

@XuNeo XuNeo force-pushed the const-lv-image-dsc branch from 0c9a81e to 73c7cf7 Compare February 3, 2024 10:08
@XuNeo XuNeo requested review from PGNetHun and kisvegabor February 4, 2024 04:43
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's approach the draw_buf and image_dsc differently.

image_dsc is the same as draw_buf just more limited. We can even say that draw_buf is a superset/extension of image_dsc.

If you agree with that we can keep lv_image_buf.h (maybe rename to lv_image_dsc.h) and include it lv_draw_buf.h.

lv_image_dsc_t should only by used to describe a constant image
resource.

lv_draw_buf_t is used to describe an image in RAM.

Move _lv_image_buf_get_transformed_area to lv_draw_image.c
Adjust image flags to distinguish between flags exclusive to draw buf

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
@XuNeo XuNeo force-pushed the const-lv-image-dsc branch from 73c7cf7 to 29bdf2f Compare February 5, 2024 15:01
@XuNeo XuNeo requested a review from kisvegabor February 5, 2024 15:02
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

XuNeo added 2 commits February 6, 2024 17:55
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
@XuNeo XuNeo force-pushed the const-lv-image-dsc branch from 5cda89c to d80da1b Compare February 6, 2024 09:57
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
@XuNeo XuNeo requested a review from kisvegabor February 6, 2024 11:26
kisvegabor
kisvegabor previously approved these changes Feb 7, 2024
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PGNetHun Could you also take a look at it?

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
@XuNeo XuNeo force-pushed the const-lv-image-dsc branch from ec88a97 to de6ab4e Compare February 15, 2024 06:52
* @param buf the buffer to store image data. It must meet align requirement.
* @param buf_size provided buffer size in bytes.
* @return LV_RESULT_OK on success, LV_RESULT_INVALID on error.
* @deprecated Use lv_snapshot_take_to_draw_buf instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some places @deprecated is the first comment line, here it is simply added after @return

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think generated doc will include deprecated note, no matter where it locates. Let's see if it's true.

@XuNeo XuNeo merged commit bd11904 into lvgl:master Feb 18, 2024
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
…vgl#5496)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
…vgl#5496)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use image_buf instead of draw_buf

3 participants