-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactory the logic to handle force decode logic to avoid CA copy frame buffer, introduce SDImageForceDecodePolicy detailed control #3559
Conversation
71c17a3
to
6938175
Compare
The |
Added new SDImageForceDecodePolicy, which seems match user's feedback about details control, like |
SDWebImage/Private/SDDeviceHelper.h
Outdated
@@ -14,5 +14,6 @@ | |||
|
|||
+ (NSUInteger)totalMemory; | |||
+ (NSUInteger)freeMemory; | |||
+ (size_t)cacheLineSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useless.
42979e6
to
99873fc
Compare
…ck to handle the decode output bitmap info Include: colorspace, byte alignment, bitmap info Remove the exists hardcode on BGRA8888
Now it's will mark as false for not byte-aligned CGImage
The sd_isDecoded default value only check once
…iggerCACopyImage`
…orce-decode using automatic check, always or never Deprecate the `SDWebImageAvoidDecodeImage` This can help for some user who don't use ImageIO and need to ensure the memory footprint
…ed image and vector image to not break them
Should use device RGB, like Color LCD
c771362
to
ed1a44b
Compare
…e and cause copy Fix the NSColor should still convert to sRGB for print...
e3b6900
to
1fc9d4b
Compare
1fc9d4b
to
808cedc
Compare
New Pull Request Checklist
I have read and understood the CONTRIBUTING guide
I have read the Documentation
I have searched for a similar pull request in the project and found none
I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)
I have added the required tests to prove the fix/feature I am adding
I have updated the documentation (if necessary)
I have run the tests and they pass
I have run the lint and it passes (
pod lib lint
)This merge request fixes / refers to the following issues: ...
Pull Request Description
This close #3417
Reason
This commit: ff6b3b9 cause to not force decode on
Non-ImageIO
created CGImage. In theory it's correct because like libwebp-created CGImage has already bitmap buffer in RAM.However, this change has bad effect on final RAM usage. Because of https://github.com/path/FastImageCache#byte-alignment
When some bad coder (The SDWebImageWebPCoder in that example), does not handle the byte alignment correctly, CoreAnimation will try to copy the bitmap buffer when rendering, cause
2 * bitmap buffer
usage, instead of 1.You can use Xcode's
Color Copied Image
to find this behavior.See:
Solution