Decode WebP images directly into a buffer Core Animation likes#600
Decode WebP images directly into a buffer Core Animation likes#600garrettmoon merged 5 commits intopinterest:masterfrom
Conversation
Without this change, the images we output aren't compatible with the GPU and so CA has to copy them all on the main thread at commit time, which means stutters. Plus memory bloat. The difference here is so substantial that you may seriously want to consider re-running a WebP experiment if you did in the past and bailed on it.
|
Also updated the PR to attempt to use CGImageSource – which supports WebP at least as of iOS 14 – before trying our own manual WebP decoding. |
|
Looks like the CI failure is a config issue unrelated to the CL. WDYT about the change @garrettmoon ? Also hi! Long time no code. |
|
Long time no code! I think the CI issue is real? I think the releaseData method needs to be ifdef'd out for iOS? My only concern about this PR is the bit rot that will happen on macOS… Any chance you can try and unify some of the code for macOS in a follow up? |
|
OK updated – lmk |
garrettmoon
left a comment
There was a problem hiding this comment.
Looks good to me, thank you @Adlai-Holler !
You… uh… think you can apply this to the animated webp code path next? :D
* master-pinremoteimage: Disable asserts in release builds when using Swift Package Manager unarchiveObjectWithData: and archivedDataWithRootObject: are deprecated (pinterest#610) update comment Set cachePolicy accordingly when PINRemoteImageManagerDownloadOptionsIgnoreCache is provided Decode WebP images directly into a buffer Core Animation likes (pinterest#600) Xcode 12.5 / SPM - Add missing headers to fix build errors with SPM and Xcode 12.5 (pinterest#597) Fixed spm integration on regular Xcode project (pinterest#586) Fix PINRemoteImageManager.h Close Comment Formatting (pinterest#594) Fix typo in PINRemoteImageManager.html (pinterest#593) Carthage is broken on Xcode 12 (pinterest#584) Update podspec to match release Hopefully fix publish for real this time... # Conflicts: # Package.swift
Without this change, the images we output aren't compatible with the GPU and so CA has to copy them all on the main thread at commit time, which means stutters. Plus memory bloat.
The difference here is so substantial that you may seriously want to consider re-running a WebP experiment if you did in the past and bailed on it.
CA::copy_imagebefore:After:

Yes I am too lazy to figure out how to do this on macOS, and for that I am sorry. Desktops are fast anyway!