-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(draw_buf): distinguish between lv_image_dsc_t and lv_draw_buf_t #5496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7a0539d to
c65883e
Compare
kisvegabor
left a comment
There was a problem hiding this 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.
0c9a81e to
73c7cf7
Compare
kisvegabor
left a comment
There was a problem hiding this 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>
73c7cf7 to
29bdf2f
Compare
kisvegabor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
5cda89c to
d80da1b
Compare
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
kisvegabor
left a comment
There was a problem hiding this 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: Xu Xingliang <xuxingliang@xiaomi.com>
ec88a97 to
de6ab4e
Compare
| * @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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
…vgl#5496) Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com> Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
…vgl#5496) Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com> Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
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
lv_conf_template.hrun lv_conf_internal_gen.py and update Kconfig.scripts/code-format.py(astyle needs to be installed) and follow the Code Conventions