Skip to content

v4.5.12

Latest

Choose a tag to compare

@kevingpqi123 kevingpqi123 released this 14 Dec 10:31
· 23 commits to release/4.5 since this release

主要修改内容
(1) 版本新增

  • Web 平台:新增支持多线程版本

(2) 接口变更

  • Android 和 iOS 平台: PAGLayer 新增设置和读取 alpha 的接口
  • 鸿蒙平台: PAGView 和 PAGImageView 新增 ComponentV2 支持

(3) 性能优化
tgfx 升级至 2.1.1 版本,基础图形渲染(如 Rect)的性能相比之前提升 10 倍,文本渲染性能相比之前提升 20 倍

主要优化

  • 切换使用无锁队列,支持无上限队列任务调度
  • 增加文本图集渲染能力,以及 bounds 快速估算能力,提升文本渲染性能
  • 全面采用 SIMD 指令加速,实现更快的数学计算
  • 重构整个渲染链路,提前判断否可合并再创建最终渲染对象,避免大量对象频繁创建销毁的开销
  • 引入内存池优化技术,全链路的海量临时对象全部集中分配内存,减少堆内存分配的开销
  • 增加对 4K 等超大图片的自动降级缓存,减少内存占用

(4)包体优化

  • Web 平台:删除 ASYNCIFY 编译参数,包体相比之前减少 25%, 移除 Web Worker版本,使用原生的 pthread 多线程版本替代
  • 鸿蒙平台: so 库文件只保留 PAG 公开接口符号

(5)功能完善和稳定性提升

  • Web 平台:重构帧渲染逻辑实现异步处理视频解码
  • Web 平台:修复禁用 RTTI 后 PAGLayer 类型不正确的问题
  • Web 平台:修复 replaceImage 等接口调用报错的问题
  • Web 平台:修复 readPixels 返回为空的问题
  • Web 平台:修复网页视频解码卡顿问题,并提高 React 导入兼容性
  • 鸿蒙平台: 修复内存泄漏问题
  • 修复当所有图片图层都可编辑时 File::editableImages 为 nullptr 导致的缩放模式不正确的问题

Main modifications:
(1) Version Additions

  • Web Platform: Added support for a multi-threaded version.

(2) Interface Changes

  • Android and iOS Platforms: Added interfaces to set and read alpha values for PAGLayer.
  • HarmonyOS Platform: Added ComponentV2 support for PAGView and PAGImageView.

(3) Performance Optimization
Upgraded tgfx to version 2.1.1, achieving significant performance improvements: 10x faster for basic graphics rendering (e.g., Rect) and 20x faster for text rendering.

Key Optimizations:

  • Switched to a lock-free queue, enabling unlimited task scheduling.
  • Added text atlas rendering and fast bounds estimation capabilities to improve text rendering performance.
  • Fully adopted SIMD instructions for faster mathematical computations.
  • Refactored the entire rendering pipeline to determine mergeability early, avoiding frequent creation and destruction of rendering objects.
  • Introduced memory pool optimization to centralize memory allocation for temporary objects, reducing heap memory overhead.
  • Automatic downgrade caching for ultra-large images (e.g., 4K) was added to reduce memory usage.

(4) Package Size Optimization

  • Web Platform: Removed ASYNCIFY compilation parameter, reducing package size by 25%. Replaced the Web Worker version with a native pthread multi-threaded version.
  • HarmonyOS Platform: Retain only pag-related symbols in the .so file.

(5) Feature Improvements and Stability Enhancements

  • Web Platform: Refactored frame rendering logic to handle video decoding asynchronously.
  • Web Platform: Fixed incorrect PAGLayer type issue when RTTI is disabled.
  • Web Platform: Fixed errors when calling replaceImage and other interfaces.
  • Web Platform: Fixed the issue where readPixels returned empty results.
  • Web Platform:Fix web video decoding stuttering and improve React import compatibility.
  • HarmonyOS Platform:Fixed memory leak issues.
  • Fixed the incorrect scaling mode issue caused by File::editableImages being nullptr when all image layers are editable.