mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Move the default animated image runloop mode to a constant, and fallback to the constant if the runloop mode is set to nil
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASWeakProxy.h"
|
||||
|
||||
NSString *const ASAnimatedImageDefaultRunLoopMode = NSDefaultRunLoopMode;
|
||||
|
||||
@implementation ASImageNode (AnimatedImage)
|
||||
|
||||
#pragma mark - GIF support
|
||||
@@ -95,6 +97,10 @@
|
||||
{
|
||||
ASDN::MutexLocker l(_displayLinkLock);
|
||||
|
||||
if (runLoopMode == nil) {
|
||||
runLoopMode = ASAnimatedImageDefaultRunLoopMode;
|
||||
}
|
||||
|
||||
if (_displayLink != nil) {
|
||||
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:_animatedImageRunLoopMode];
|
||||
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:runLoopMode];
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
_cropRect = CGRectMake(0.5, 0.5, 0, 0);
|
||||
_cropDisplayBounds = CGRectNull;
|
||||
_placeholderColor = ASDisplayNodeDefaultPlaceholderColor();
|
||||
_animatedImageRunLoopMode = NSDefaultRunLoopMode;
|
||||
_animatedImageRunLoopMode = ASAnimatedImageDefaultRunLoopMode;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "ASThread.h"
|
||||
|
||||
extern NSString *const ASAnimatedImageDefaultRunLoopMode;
|
||||
|
||||
@interface ASImageNode ()
|
||||
{
|
||||
ASDN::RecursiveMutex _animatedImageLock;
|
||||
|
||||
Reference in New Issue
Block a user