-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optimize raster performance on Animated images. (#513)
The I/O bottleneck can impact the performance of the raster thread in Flutter. When WebF pages contain multiple GIF images, each frame of these GIFs requires the I/O thread to fetch its next frame, potentially turning the I/O thread into a bottleneck. This PR introduces an intersectionObserverLayer for each GIF image, monitoring the visibility of each animated image. If an ImageElement scrolls outside the viewport, the imageFrame event listeners will be detached from the imageStreamListener, and the next frame request for that image will be paused. With this update, only the animated images visible in the viewport will request the next frame, significantly reducing the load on the I/O thread. Related issue for Flutter: flutter/flutter#135443
- Loading branch information
Showing
3 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
2 changes: 1 addition & 1 deletion
2
webf/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains 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
This file contains 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