mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
5bb5ea7135
Summary: This works with D3305161 to minimize image flashing. After D3305161, the completion handler passed to `-[RCTImageLoader loadImageWithoutClipping:size:scale:resizeMode:progressBlock:completionBlock:]` may be called back on the main queue in the case of a cached image. In this case, we want to set the image view's image property synchronously rather than on the next runloop iteration via dispatch_async. This minimizes the amount of image flashing the user sees when displaying a cached image. The exception to this case is for blurred images. A blur can be an expensive (taking multiple ms on the CPU), so we always make sure to perform the blur off the main queue even if the image is cached and the callback came back on the main queue. Reviewed By: nicklockwood Differential Revision: D3310176 fbshipit-source-id: 6820782527b65e4956879cf06e8ed2c09c622a58