Commit Graph

3532 Commits

Author SHA1 Message Date
DreamPiggy 8efa42e6bc Code garden for test cases 2023-07-14 00:03:06 +08:00
DreamPiggy 8f16a63d7f
Merge pull request #3559 from dreampiggy/performance/default_bitmap_and_force_decode
Refactory the logic to handle force decode logic to avoid CA copy frame buffer, introduce SDImageForceDecodePolicy detailed control
2023-07-13 23:59:03 +08:00
DreamPiggy 808cedc7e5 Rename to use struct to return the alignment, preserve for future HDR support 2023-07-13 23:41:09 +08:00
DreamPiggy 45b497c5f6 Fix the macOS force decode colorspace does not match screen colorspace and cause copy
Fix the NSColor should still convert to sRGB for print...
2023-07-13 23:31:19 +08:00
DreamPiggy 67da434e79 Fix the colorspace of hardware supported on macOS
Should use device RGB, like Color LCD
2023-07-13 22:58:32 +08:00
DreamPiggy cc89e14fdd Fix the handle of ForceDecodePolicyAlways, still need to check animated image and vector image to not break them 2023-07-13 22:58:32 +08:00
DreamPiggy 3e382b234d Fix the handle to context option and add test case 2023-07-13 22:58:32 +08:00
DreamPiggy b4af7cc5ef Removed the unused cache line size helper method 2023-07-13 22:58:32 +08:00
DreamPiggy 1a61c8d2d9 Update test case for SDImageForceDecodePolicyAutomatic 2023-07-13 22:58:32 +08:00
DreamPiggy e1c01fe28b Introduce `SDImageForceDecodePolicy`, which can controls whether to force-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
2023-07-13 22:58:32 +08:00
DreamPiggy 69c98c5f71 Added test case `test28ThatNotTriggerCACopyImage` and `test28ThatDoTriggerCACopyImage` 2023-07-13 22:58:32 +08:00
DreamPiggy f6ca661537 Update the correct byte alignment and check with 8 * 4 bytes
The sd_isDecoded default value only check once
2023-07-13 22:58:32 +08:00
DreamPiggy 06589dbcc4 Update the default force decode value, partial revert ff6b3b9bb5
Now it's will mark as false for not byte-aligned CGImage
2023-07-13 22:58:32 +08:00
DreamPiggy b4559994ea Provide the API for custom coders (like WebPCoder) to use runtime check to handle the decode output bitmap info
Include: colorspace, byte alignment, bitmap info

Remove the exists hardcode on BGRA8888
2023-07-13 22:58:32 +08:00
DreamPiggy f5f27a9e01
Merge pull request #3561 from dreampiggy/bugfix/macOS_limitBytes_animatedImageRep
Fix macOS bug that SDImageCoderDecodeScaleDownLimitBytes still use the AnimatedImageRep and beyond the byte limit
2023-07-13 22:53:09 +08:00
DreamPiggy 47fd1c9a10 Fix the bug that SDImageCoderDecodeScaleDownLimitBytes still use the AnimatedImageRep and beyond the byte limit
Also, expose the limit bytes calculation utils method
2023-07-13 22:32:27 +08:00
DreamPiggy c51ba84499 Bumped version to 5.16.0
update CHANGELOG
2023-06-04 14:19:24 +08:00
DreamPiggy 90aa750c92
Merge pull request #3547 from dreampiggy/doc/update_api_document
Update some comments to allows SwiftDocC generate better page
2023-06-04 14:02:00 +08:00
DreamPiggy 82793d27bf Update some comments to allows SwiftDocC generate better page 2023-06-04 13:31:22 +08:00
DreamPiggy 5c14e73f70 Added description about the non-cache key awareness for .scaleDownLimitBytes
May be changed in the future if user reply
2023-06-04 13:30:42 +08:00
DreamPiggy b27c579f47
Merge pull request #3537 from dreampiggy/feature/coder_scale_down_limit_bytes_auto
Introduce the automatically calculation of thumbnail (include animated/static image) using `SDImageCoderDecodeScaleDownLimitBytes`
2023-06-04 12:45:36 +08:00
DreamPiggy c27e18506d
Merge pull request #3524 from dreampiggy/feature/sdanimatedimage_frame_pool
Performance: Introduce frame pool for SDAnimatedImage playback. Solve when multiple image view references the same URL image cause un-wanted decode which waste RAM/CPU
2023-06-04 12:38:52 +08:00
DreamPiggy 7f9fb5d43e Bumped version to 5.15.8
update CHANGELOG
2023-05-15 18:09:30 +08:00
DreamPiggy e85d1e5c36
Merge pull request #3535 from dreampiggy/feature/SDAnimatedImage_scale
Update the implementation `SDScaledImageForScaleFactor` to support SDAnimatedImage
2023-05-15 17:58:20 +08:00
DreamPiggy 91162ce5dc Update the example with new SDWebImageScaleDownLargeImages 2023-05-15 17:34:38 +08:00
DreamPiggy 91ff7189c9 Introduce the automatically calculation of thumbnail (include animated/static image) using `SDImageCoderDecodeScaleDownLimitBytes`
The exist SDWebImageScaleDownLargeImages translate to new option instead
2023-05-15 17:34:06 +08:00
DreamPiggy f3ea1eee67 Update the check logic to detect `Multiple Frame Animated Image` 2023-05-15 14:51:42 +08:00
DreamPiggy 2331bcc690 Update the implementation `SDScaledImageForScaleFactor` to support SDAnimatedImage 2023-05-15 14:50:59 +08:00
DreamPiggy d82f5574e4
Merge pull request #3531 from dreampiggy/bugfix/macos_SDDisplayLink_crash_during_dealloc
Try to fix macOS SDDisplayLink crash because of accessing the deallocated objc pointer during CVDisplayLinkRef callback
2023-05-10 16:31:15 +08:00
DreamPiggy 08ca5f4b22 Try to fix the SDDisplayLink danger pointer because of unsafe_unretained for self from the CVDisplayLinkRef
Using the same solution from iOS/watchOS via SDWeakProxy
2023-05-10 16:00:00 +08:00
DreamPiggy 507f1b6b45 Using lock to ensure SDImageFramePool register/unregister logic in multi-thread environment 2023-05-09 16:50:41 +08:00
DreamPiggy 181f8d2183 Fix the issue that per-provider frame pool does not get dealloced 2023-05-09 16:50:41 +08:00
DreamPiggy ef69460dc7 Fix the test case test26AnimatedImageStopAnimatingClearBuffer 2023-05-09 16:50:41 +08:00
DreamPiggy 858b64aef7 Try to optimize the time when calculate the maxBufferCount, it's cheap to get free memory so we check each time before prefetch
Also, move the memory warning handler into frame pool class (100 player may use one frame pool)
2023-05-09 16:50:41 +08:00
DreamPiggy a206229905 Introduce frame pool for SDAnimatedImage playback. Solve when multiple image view references the same URL image cause un-wanted decode which waste RAM/CPU 2023-05-09 16:50:41 +08:00
DreamPiggy 3289629ef6 Bumped version to 5.15.7
update CHANGELOG
2023-05-06 16:22:13 +08:00
DreamPiggy 09f0fdd189
Merge pull request #3526 from dreampiggy/bugfix/try_avoid_inline_sdcallback_queue
Try to solve the strange dispatch group crash in SDSafeExecute by removing inline
2023-05-06 15:55:18 +08:00
DreamPiggy 5481aa2e16
Merge pull request #3523 from dreampiggy/opt/same_url_query_extra_decode_store
Performance: Opt when multiple same URL query in parallels, which may cause duplicated decode and store disk operation
2023-05-05 18:57:01 +08:00
DreamPiggy ada908a853 Extended gcd queue to avoid SDCallbackQueue dealloc while during dispatch 2023-05-05 18:51:12 +08:00
DreamPiggy 17b5a1d9ab Check queue equality only when queue specific is available 2023-05-05 18:46:37 +08:00
DreamPiggy 4ffd068762 Try to solve the strange dispatch group crash in SDSafeExecute by removing inline
Guessing the queue ARC lifecycle is wrong during some of compiler optimization
2023-05-05 18:41:20 +08:00
DreamPiggy 71bcdf006a Performance: Opt when multiple same URL query in parallels, which may cause duplicated decode and store disk operation 2023-04-25 18:25:05 +08:00
DreamPiggy 20df851f2a Bumped version to 5.15.6
update CHANGELOG
2023-04-23 23:21:53 +08:00
DreamPiggy 1fdb22578c
Merge pull request #3520 from dreampiggy/bugfix/watchos_animated_image_duration
Revert the SDDisplayLink for watchOS, fix the animated image duration bug
2023-04-23 21:35:35 +08:00
DreamPiggy eb8b62b170 Fix the test case `test57SDImageCachesManagerOperationPolicySerial` that remove the cache path directory 2023-04-21 20:39:49 +08:00
DreamPiggy 4cee95d5a2 Revert the SDDisplayLink for watchOS, fix the animated image duration bug 2023-04-21 18:53:36 +08:00
DreamPiggy a549e99922
Merge pull request #3519 from dreampiggy/bugfix/warning_c_no_param
Fix the warning of C function with no param
2023-04-21 15:54:19 +08:00
DreamPiggy ec278a2fb5 Fix the warning of C function with no param 2023-04-21 15:52:41 +08:00
DreamPiggy b4d32dc85d
Merge pull request #3517 from timonus/save-perf
Small improvements to SDDiskCache write perf.
2023-04-21 15:32:28 +08:00
Tim Johnsen c79416bc2e Ensure directory exists on init instead of on each save. 2023-04-18 16:29:24 -07:00