Changelog(更改日志)
v9.0.0
Migration guide(迁移指南)
显示原文
As v9 is a major version it contains API breaking changes too. Most of the conceptual changes in v9 were internal, however the API was affected some widgets reword and refactoring as well.
由于 v9 是一个主要版本,它也包含 API 重大更改。v9 中的大多数概念更改都是内部的,但是 API 也受到了一些小部件重写和重构的影响。
IMPORTANT(重要)
显示原文
If you are updating a v8 project to v9, special care must be taken as some parts
will not result in compiler error, but LVGL might not work due to related issues
will result in hard to understand compiler errors
So pay extra attention to these:
lv_display_set_buffers(display, buf1, buf2, buf_size_byte, mode)()is more or less the equivalent oflv_disp_draw_buf_init(&draw_buf_dsc, buf1, buf2, buf_size_px)from v8, however in v9 the buffer size is set in bytes.In v9
lv_color_tis always RGB888 regardless ofLV_COLOR_DEPTH.lv_conf.hhas been changed a lot, so don't forget to update it fromlv_conf_template.hBe sure
<stdint.h>is not included inlv_conf.h. In v9 we have some assembly parts for even better performance and a random include there would mess up the assembly part.The online image converter in not updated yet. Until that use LVGLImage.py .
Run time dithering is rendering due its complexity and lack of GPU support. Smaller dithered and tiled images can be used as background images as a replacement.
STM32's DMA2D (Chrom-ART) support is removed for now. It will be added again when an official partnership starts with ST too.
SJPG was removed as the original TJPGD support decoding tile-by-tile. (typically a tile is 8x8 pixels)
LV_COLOR_DEPTH 8is not supported yet. In v8 it meant RGB332, in v9 it will be used for L8.
如果要将 v8 项目更新到 v9,必须特别注意某些部分
不会导致编译器错误,但 LVGL 可能由于相关问题而无法工作
将导致难以理解的编译器错误
所以要格外注意这些:
lv_display_set_buffers(display, buf1, buf2, buf_size_byte, mode)()或多或少与 v8 中的lv_disp_draw_buf_init(&draw_buf_dsc, buf1, buf2, buf_size_px)相同,但是在v9 中, 缓冲区大小以字节为单位设置。在 v9 中 无论
lv_conf_template.h如何,lv_color_t始终是 RGB888,.lv_conf.h已经改变了很多,所有不要忘记更新它lv_conf_template.h确保
<stdint.h>不包含 在lv_conf.h。 在 v9 中,我们有一些组装部件以获得更好的性能,随机包含会弄乱组装部件。在线图像转换器尚未更新。直到使用 LVGLImage.py 。
由于其复杂性和缺乏 GPU 支持,运行时抖动正在渲染。较小的抖动和平铺图像可以用作背景图像作为替代。
STM32 的 DMA2D (Chrom-ART) 支持暂时被删除。当与 ST 建立正式合作伙伴关系时,也会再次添加它。
SJPG 被删除,因为原来的 TJPGD 支持逐图块解码。(通常一个图块是 8x8 像素)
还不支持
LV_COLOR_DEPTH 8。在v8中,它意味着RGB332,在v9中,它将用于L8。
Main new features(主要新功能)
显示原文
Run time display color format adjustment with RGB888 support
Built-in support
pthread,FreeRTOSand other (RT)OSes which are used during renderingBuilt-in support LVGL's, C library, and other ``stdlib``s
Better parallel rendering architecture. See the details here
Built in display and touch driver: SDL, Linux Frame buffer, NuttX LCD and touch drivers, ST7789 and ILI9341 driver are available and more will come soon
Observer(观察者) allows to bind data to UI elements and create a uniform and easy to maintain API
GitHub CodeSpace integration makes possible to run LVGL in an Online VSCode editor with 3 click. See more here
Add vector graphics support via ThorVG. It can be used to draw vector graphics to a Canvas
lv_image.h supports aligning, stretching or tiling the image source if the widget is larger or smaller.
支持 RGB888 的运行时显示颜色格式调整
内置支持
pthread,FreeRTOS以及渲染期间使用的其他(RT)操作系统内置支持 LVGL、C 库和其他
stdlibs更好的并行渲染架构。请参阅 此处的详细信息
内置显示和触摸驱动程序:SDL、Linux 帧缓冲区、NuttX LCD 和触摸驱动程序、ST7789 和 ILI9341 驱动程序均可用,更多内容即将推出
Observer(观察者) 允许将数据绑定到 UI 元素并创建统一且易于维护的 API
GitHub CodeSpace 集成使得只需单击 3 次即可在在线 VSCode 编辑器中运行 LVGL。 在这里 查看更多内容
通过 ThorVG 添加矢量图形支持。它可用于将矢量图形绘制到 画布 上
lv_image.h 如果小部件更大或更小, lv_image.h支持对齐、拉伸或平铺图像源。
General API changes(常规 API 更改)
显示原文
Although lv_api_map.h address most of the refactoring we encourage you to use the latest API directly.
lv_disp_...is renamed tolv_display_...btn_...is renamed tobutton_...btnmatrix_...is renamed tobuttonmatrix_...img_...is renamed toimage_...zoomis renamed toscaleangleis renamed torotationscris renamed toscreenactis renamed toactivedelis renamed todeletecolis renamed tocolumnlv_obj_clear_flagis renamed tolv_obj_remove_flaglv_obj_clear_stateis renamed tolv_obj_remove_statelv_coord_twas removed and replaced byint32_t
尽管 lv_api_map.h 解决了大部分重构问题,但我们鼓励您直接使用最新的 API。
lv_disp_...被重命名为lv_display_...btn_...被重命名为button_...btnmatrix_...被重命名为buttonmatrix_...img_...被重命名为image_...zoom被重命名为scaleangle被重命名为rotationscr被重命名为screenact被重命名为activedel被重命名为deletecol被重命名为columnlv_obj_clear_flag被重命名为lv_obj_remove_flaglv_obj_clear_state被重命名为lv_obj_remove_statelv_coord_t被删除并替换为int32_t
New color format management(新的颜色格式管理)
显示原文
LV_IMG_CF_...was replaced byLV_COLOR_FORMAT_...LV_COLOR_DEPTH 24is supported for RGB888 renderinglv_color_talways means RGB888
LV_IMG_CF_...被替换为LV_COLOR_FORMAT_...LV_COLOR_DEPTH 24支持RGB888渲染lv_color_t始终表示 RGB888
Display API(显示API)
显示原文
lv_disp_drv_tandlv_disp_draw_buf_twas removedTo create a display and set it up:
lv_display_t * disp = lv_display_create(hor_res, ver_res)
lv_display_set_flush_cb(disp, flush_cb);
lv_display_set_buffers(disp, buf1, buf2, buf_size_in_bytes, mode);
Note that now buf size is in bytes and not pixels
modecan be:LV_DISPLAY_RENDER_MODE_PARTIALThis way the buffers can be smaller then the display to save RAM. At least 1/10 screen sized buffer(s) are recommended.LV_DISPLAY_RENDER_MODE_DIRECTThe buffer(s) has to be screen sized and LVGL will render into the correct location of the buffer. This way the buffer always contain the whole image. With 2 buffers the buffers’ content are kept in sync automatically. (Old v7 behavior)LV_DISPLAY_RENDER_MODE_FULLJust always redraw the whole screen. With 2 buffers is a standard double buffering.
Similarly to the widgets, now you can attach events to the display too, using
lv_display_add_event()monitor_cbis removed andLV_EVENT_RENDER_READYevent is fired insteadInstead of having display background color and image,
lv_layer_bottom()is added where any color can be set or any widget can be created.The target color format can be adjusted in the display in runtime by calling
lv_display_set_color_format(disp, LV_COLOR_FORMAT_...)LV_COLOR_16_SWAPis removed andlv_draw_sw_rgb565_swap()can be called manually in theflush_cbif needed to swap the in-place.disp_drv.scr_transpwas removed andlv_display_set_color_format(disp, LV_COLOR_FORMAT_NATIVE_ALPHA)can be used insteadset_px_cbis removed. You can can convert the rendered image in theflush_cb.For more details check out the docs `here /porting/display>`__ and `here /overview/display>`__.
lv_disp_drv_t和lv_disp_draw_buf_t被删除要创建显示并设置它:
lv_display_t * disp = lv_display_create(hor_res, ver_res)
lv_display_set_flush_cb(disp, flush_cb);
lv_display_set_buffers(disp, buf1, buf2, buf_size_in_bytes, mode);
请注意, 现在buf 大小以字节为单位,而不是像素
mode可以是:
LV_DISPLAY_RENDER_MODE_PARTIAL这样缓冲区可以比显示器更小,以节省 RAM。建议至少使用 1/10 屏幕大小的缓冲区。LV_DISPLAY_RENDER_MODE_DIRECT缓冲区必须是屏幕大小的,LVGL 将渲染到缓冲区的正确位置。这样缓冲区始终包含整个图像。使用 2 个缓冲区时,缓冲区的内容会自动保持同步。(旧的 v7 行为)LV_DISPLAY_RENDER_MODE_FULL总是重画整个屏幕。有 2 个缓冲区是标准的双缓冲区。
与小部件类似,现在您也可以将事件附加到显示,使用
lv_display_add_event()。monitor_cb被删除并且LV_EVENT_RENDER_READY触发事件。不是显示背景颜色和图像,而
lv_layer_bottom()添加可以设置任何颜色或可以创建任何小部件的位置。可以在运行时通过调用
lv_display_set_color_format(disp, LV_COLOR_FORMAT_...)在显示中调整目标颜色格式。LV_COLOR_16_SWAP已删除,如果需要 在flush_cb交换,lv_draw_sw_rgb565_swap()可以手动调用。disp_drv.scr_transp已被删除并且lv_display_set_color_format(disp, LV_COLOR_FORMAT_NATIVE_ALPHA)可以替代使用。set_px_cb已删除。您可以将渲染的图像转换为flush_cb.
有关更多详细信息,请查看文档 `here /porting/display>`__ 和 `here /overview/display>`__ 。
Indev API(独立开发API)
显示原文
Similarly to the display
lv_indev_drv_twas removed and an input device can be created like this:Similarly to the widgets, now you can attach events to the indevs too, using
lv_indev_add_event()The
feedback_cbwas removed, insteadLV_EVENT_PRESSED/CLICKED/etcevents are sent to the input device
lv_indev_drv_t与删除显示器类似,可以像这样创建输入设备:与小部件类似,现在您也可以将事件附加到 indevs,使用
lv_indev_add_event()。已
feedback_cb被删除,而改为LV_EVENT_PRESSED/CLICKED/etc事件被发送到输入设备
lv_indev_t * indev = lv_indev_create();
lv_indev_set_type(indev, LV_INDEV_TYPE_...);
lv_indev_set_read_cb(indev, read_cb);
Others(其他)
显示原文
lv_msgis removed and replaced by lv_observerlv_chartticks support was removed, lv_scale can be used insteadlv_msgboxis update to be more flexible. It uses normal button instead of button matrixlv_tabviewwas updated to user real button instead of a button matrix
lv_msg被删除并被 lv_observer 取代lv_chart刻度线支持已删除, 可以使用 lv_scale 代替lv_msgbox正在更新以更加灵活。它使用普通按钮而不是按钮矩阵lv_tabview已更新为用户真实按钮而不是按钮矩阵
v8.3
显示原文
For Other v8.3.x releases visit the Changelog in the release/v8.3 branch .
对于其他 v8.3.x 版本,请访问 release/v8.3 分支中的变更日志。