Skip to content

Releases: Tencent/libpag

v4.5.50

17 Apr 10:37

Choose a tag to compare

主要修改内容:


(1)修复 LockGuard 和 ScopedLock 中 shared_ptr 的线程安全问题,改用原子操作

(2)修复 Android 平台 PAGImageView 访问 _composition 时的竞态条件 crash

(3)修复 PAGDecoder::checkFrameChanged 中的数据竞争问题

(4)修复 Apple 平台 NativeTextShaper::Shape 中 CFStringCreateWithCString 返回 NULL 时的 crash

(5)修复 iOS 平台 EAGLWindow 析构时 layerTexture 为空导致的 crash

(6)将磁盘缓存 IO 操作移至后台线程,避免主线程阻塞

(7)新增 EGL robustness 支持和 OpenGL context 的 GPU reset 检测

(8)鸿蒙平台新增 NativeWindow 所有权追踪,防止 double-free

Main modifications:


(1)Fix thread-safety issues in LockGuard and ScopedLock by using atomic operations for shared_ptr.

(2)Fix race condition crash when accessing _composition in PAGImageView on Android.

(3)Fix data race in PAGDecoder::checkFrameChanged.

(4)Fix crash in NativeTextShaper::Shape when CFStringCreateWithCString returns NULL on Apple platforms.

(5)Fix crash caused by null layerTexture in EAGLWindow destructor on iOS.

(6)Move disk cache IO operations to a background thread to avoid the main thread blocking.

(7)Add EGL robustness support and GPU reset detection for OpenGL contexts.

(8)Add NativeWindow ownership tracking to prevent double-free on HarmonyOS.

v4.4.52

17 Apr 10:34

Choose a tag to compare

主要修改内容:

(1)修复 LockGuard 和 ScopedLock 中 shared_ptr 的线程安全问题,改用原子操作

(2)修复 Android 平台 PAGImageView 访问 _composition 时的竞态条件 crash

(3)修复 PAGDecoder::checkFrameChanged 中的数据竞争问题

(4)修复 Apple 平台 NativeTextShaper::Shape 中 CFStringCreateWithCString 返回 NULL 时的 crash

(5)将磁盘缓存 IO 操作移至后台线程,避免主线程阻塞

(6)新增 EGL robustness 支持和 OpenGL context 的 GPU reset 检测

(7)鸿蒙平台新增 NativeWindow 所有权追踪,防止 double-free

Main modifications:


(1)Fix thread-safety issues in LockGuard and ScopedLock by using atomic operations for shared_ptr.

(2)Fix race condition crash when accessing _composition in PAGImageView on Android.

(3)Fix data race in PAGDecoder::checkFrameChanged.

(4)Fix crash in NativeTextShaper::Shape when CFStringCreateWithCString returns NULL on Apple platforms.

(5)Move disk cache IO operations to a background thread to avoid the main thread blocking.

(6)Add EGL robustness support and GPU reset detection for OpenGL contexts.

(7)Add NativeWindow ownership tracking to prevent double-free on HarmonyOS.

v4.5.36

01 Mar 15:19

Choose a tag to compare

主要修改内容:


(1)iOS 平台减少 ApplicationWillResignActive 中 deviceLocker 持有时间,防止主线程阻塞

(2)Android 平台修复 JNI 异常处理和空指针问题

(3)Android 平台修复 SafeConvertToStdString 中 jBytes 为空时的 JNI crash

(4)鸿蒙平台修复 API14+ 上使用新 text module API 时的字体回退 crash 问题

(5)鸿蒙平台修复 PAGImageView setScaleMode(None) 未重置 matrix 的问题

Main modifications:


(1)Reduce deviceLocker hold time in ApplicationWillResignActive to prevent main thread blocking on iOS.

(2)Fix JNI exception and null pointer handling on Android.

(3)Fix JNI crash when jBytes is null in SafeConvertToStdString on Android.

(4)Fix font fallback crash by using the new text module API on API14+ for the HarmonyOS platform.

(5)Fix PAGImageView setScaleMode(None) not resetting matrix on HarmonyOS.

v4.4.43

01 Mar 15:09

Choose a tag to compare

主要修改内容:
(1)iOS 平台修复进入后台时 deviceMap 非线程安全读取导致的 crash
(2)iOS 平台减少 ApplicationWillResignActive 中 deviceLocker 持有时间,防止主线程阻塞
(3)iOS 平台使用 C++ 接口替代 PAGImageView 中的实现,避免因引用计数问题导致的 crash
(4)修复 PAGLayer::removeFromParentOrOwner() 中的数据竞争问题
(5)Android 平台修复 JNI 异常处理和空指针问题,修复 SafeConvertToStdString 中 jBytes 为空时的 crash
(6)鸿蒙平台升级编译版本至 6.0.0,并仅保留 pag 相关符号在 .so 文件中
(7)鸿蒙平台修复 API14+ 上使用新 text module API 时的字体回退 crash 问题
(8)鸿蒙平台修复 PAGImageView setScaleMode(None) 未重置 matrix 的问题

Main modifications:

(1)Fix the crash caused by non-thread-safe reads of deviceMap when the iOS app enters background.
(2)Reduce deviceLocker hold time in ApplicationWillResignActive to prevent main thread blocking on iOS.
(3)Use the C++ interface in PAGImageView to avoid crashes caused by reference counting issues on iOS.
(4)Fix a data race in PAGLayer::removeFromParentOrOwner() by updating rootLocker after resetting the layer's parent.
(5)Fix JNI exception and null pointer handling on Android, fix JNI crash when jBytes is null in SafeConvertToStdString.
(6)Upgrade the HarmonyOS compilation version to 6.0.0, and retain only pag-related symbols in the .so file.
(7)Fix font fallback crash by using the new text module API on API14+ for the HarmonyOS platform.
(8)Fix PAGImageView setScaleMode(None) not resetting matrix on HarmonyOS.

v4.5.27

27 Jan 06:56

Choose a tag to compare

主要修改内容:
(1)Android 平台支持使用系统 Canvas API 渲染彩色矢量字体
(2)iOS 平台修复 PAGImageView 可能因为引用计数导致的 crash
(3)修复使用纹理 ID 创建 PAGSurface 时出现黑屏渲染的问题
(4)鸿蒙平台优化 NativeDisplayLink,将 VSync 回调执行在 UI 线程
(5)修复鸿蒙平台 NativeCodec 中的空指针检查和内存泄漏问题
(6)修复网页视频解码卡顿问题并提升 React 导入兼容性
(7)修复因 3D 图层缩放值计算错误导致深度测试失败且无法显示的问题

Main modifications:

(1) Support color vector font rendering using Android system Canvas API.
(2) Use the C++ interface in PAGImageView to avoid crashes caused by reference counting issues.

(3) Fix the issue of black screen rendering when creating PAGSurface with texture ID.
(4) Optimize NativeDisplayLink to execute VSync callback on UI thread for OHOS platform.
(5) Fix null pointer checks and memory leak in ohos NativeCodec.

(6) Fix web video decoding stuttering and improve React import compatibility.
(7) Fixed an issue where the incorrect calculation of the scaling value of the 3D layer caused the depth test to fail and was not displayed.

v4.5.12

14 Dec 10:31

Choose a tag to compare

主要修改内容
(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.

v4.5.2

29 Sep 10:38
2f4d58a

Choose a tag to compare

v4.5.2 Pre-release
Pre-release

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

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

(2) 接口变更

  • Android 和 iOS 平台: PAGLayer 新增设置和读取 alpha 的接口

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

主要优化

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

(4)包体优化

  • Web 平台:删除 ASYNCIFY 编译参数,包体相比之前减少 25%, 移除 Web Worker版本,使用原生的 pthread 多线程版本替代

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

  • Web 平台:重构帧渲染逻辑实现异步处理视频解码
  • Web 平台:修复禁用 RTTI 后 PAGLayer 类型不正确的问题
  • Web 平台:修复 replaceImage 等接口调用报错的问题
  • Web 平台:修复 readPixels 返回为空的问题
  • 修复当所有图片图层都可编辑时 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.

(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.

(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.
  • Fixed the incorrect scaling mode issue caused by File::editableImages being nullptr when all image layers are editable.

v4.4.35

18 Jul 08:22

Choose a tag to compare

主要修改内容:
(1) ffmpeg 升级至 7.0.2 版本,修复安全漏洞
(2) 支持 JPG 图片的 CMYK 色彩空间,并修复崩溃问题。
(3) 当图片未缩放时,使用 Nearest 纹理过滤选项避免出现渲染模糊。

Main modifications:
(1) Upgraded ffmpeg to version 7.0.2 to address security vulnerabilities
(2) Support CMYK color space for JPG images and fix the crash issues.
(3) Use Nearest as the texture filtering mode to avoid rendering blur when the image is not scaled.

v4.4.31

16 May 12:00

Choose a tag to compare

主要修改内容:
(1) 将文本背景的默认边距系数从 0.2f 增加到 0.4f。
(2) 修复微信小程序中在同一个canvas上多次加载pag文件导致canvas尺寸异常增大的问题

Main modifications:
(1) Increase the default margin factor for text backgrounds from 0.2f to 0.4f.
(2) Fixes an issue in WeChat Mini Programs where loading PAG files multiple times on the same canvas causes the canvas size to increase unexpectedly.

v4.4.29

30 Apr 03:39

Choose a tag to compare

主要修改内容:
(1)将鸿蒙平台中软件解码的最大送帧数量修改为 maxReorderSize + 1,修复解码异常。
(2)解码 PAG 文件时检查迭代过程中的异常,以防止内存溢出。
(3)修复在苹果平台上添加换行后部分文本无法显示的问题。
(4)修复 videoEnable 为 false 时运行 BMP 预合成素材 crash问题。

Main modifications:
(1)Modify the maximum number of software decoding frames to maxReorderSize + 1 on the HarmonyOS platform to fix decoding exceptions.
(2)Check for exceptions during iteration when decoding PAG files to prevent memory overflow.
(3)Fix the issue of partial text not displaying after adding line breaks on Apple platforms.
(4)Fix the issue of disabling videoEnable causes errors when running BMP precompositions.