Skip to content

Releases: Tencent/libpag

v4.5.70

02 Jun 11:03

Choose a tag to compare

主要修改内容:

(1)修复鸿蒙平台 NV12 上传在 Mali 驱动上因缓冲区越界读取导致的崩溃问题。

(2)修复 iOS 平台 VideoToolbox 在应用切换到后台时看门狗挂起的问题(通过主动销毁解码器 session)。

Main modifications:

(1)Fix HarmonyOS NV12 upload crash by padding frame buffer for Mali driver overread.

(2)Fix iOS VideoToolbox watchdog hangs on app deactivation by invalidating decoder session.

v4.5.68

01 Jun 12:13

Choose a tag to compare

主要修改内容:

(1)修复 PAGImageView.flush() 中 bitmapCache.put() 在锁外调用导致的空指针异常。

(2)修复 HarmonyOS Worker 线程崩溃问题,增强 JsHelper 错误处理。

(3)将 OHOSVideoDecoder 销毁移至后台线程,避免同步 IPC 阻塞调用线程。

(4)修复 HarmonyOS NV12 纹理上传崩溃,在软解码路径中紧凑排列 UV 平面。

(5)修复 HarmonyOS PAGView/PAGImageView 回调泄漏和 OHOSVideoDecoder use-after-free 问题。

(6)更新 tgfx 修复 Android 模拟器 GPU 桩导致的误判 context-lost 问题。

Main modifications:

(1)Fix NPE in PAGImageView.flush() by moving bitmapCache.put() inside the bitmapLock synchronized block.

(2)Fix OHOS Worker crash and harden JsHelper error handling.

(3)Move OHOSVideoDecoder destruction to a background task to avoid blocking the caller thread on synchronous IPC.

(4)Fix HarmonyOS NV12 texture upload crash by tightly packing UV plane in software decode path.

(5)Fix HarmonyOS PAGView/PAGImageView callback leaks and OHOSVideoDecoder use-after-free.

(6)Update tgfx to fix false context-lost on Android emulator GPU stubs.

v4.5.52

28 Apr 10:48

Choose a tag to compare

主要修改内容:

(1)修复 PAGImageView 在 iOS/HarmonyOS 平台因动画器更新重入互斥锁导致的死锁问题

(2)修复 Web 平台 VideoReader 在异步操作期间未正确处理销毁状态的问题

Main modifications:

(1)Fix PAGImageView deadlock on iOS/HarmonyOS caused by animator update re-entering mutex.

(2)Fix Web VideoReader not handling destroy state properly during async operations.

v4.4.53

28 Apr 10:50

Choose a tag to compare

主要修改内容:

(1)修复 PAGImageView 在 iOS/HarmonyOS 平台因动画器更新重入互斥锁导致的死锁问题

Main modifications:

(1)Fix PAGImageView deadlock on iOS/HarmonyOS caused by animator update re-entering mutex.

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.