Context pool#135
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
==========================================
+ Coverage 79.24% 79.33% +0.09%
==========================================
Files 710 712 +2
Lines 70247 70398 +151
==========================================
+ Hits 55664 55848 +184
+ Misses 14583 14550 -33
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to GPU offscreen rendering, especially for Lottie alpha/luma mattes, isolated-opacity layers, and cached precomps. The main focus is on efficient reuse and management of GPU resources, enabling recursive and sequential rendering without unnecessary allocations or context switches. The changes add a new resource pooling mechanism for offscreen canvases and update the rendering code to leverage these pools, resulting in better performance and reduced GPU memory usage. Documentation and comments are also updated to clarify the new behavior.
GPU Resource Pooling and Management:
AnimationRenderResourcesfor offscreen GPU canvases (target/source/result triples) and precomp canvases, with context-aware pooling and automatic reuse across frames and recursive renders. This includes the newMatteCanvasLeasemove-only class to manage canvas lifetimes. [1] [2] [3] [4]AnimationRendererto use the new resource pool for mattes and precomps, replacing per-frame allocation with pooled canvases. This affects both matte rendering and precomp rendering, and ensures correct resource sharing and cleanup. [1] [2] [3] [4] [5] [6] [7] [8]Backend and Context Handling:
GraphicsContextandOffscreenTargetAPIs and documentation to clarify that offscreen targets can now be nested and that contexts are reserved only while a target frame is active, allowing for safe recursive and sequential rendering. [1] [2] [3]Graphicsto ensure that offscreen targets are properly ended if not already committed, preventing resource leaks.Bug Fixes and Documentation:
These changes collectively make GPU-based matte and precomp rendering more robust, efficient, and easier to maintain, especially in complex Lottie animation scenarios.