mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-06 13:12:49 +00:00
Remove caching of _drawParameter and use bounds instead of threadSafeBounds
This commit is contained in:
@@ -174,7 +174,7 @@ struct ASImageNodeDrawParameters {
|
||||
ASDN::MutexLocker l(_imageLock);
|
||||
|
||||
_drawParameter = {
|
||||
.bounds = self.threadSafeBounds,
|
||||
.bounds = self.bounds,
|
||||
.opaque = self.opaque,
|
||||
.contentsScale = _contentsScaleForDisplay,
|
||||
.backgroundColor = self.backgroundColor,
|
||||
|
||||
@@ -210,16 +210,9 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
- (void)setBounds:(CGRect)bounds
|
||||
{
|
||||
[super setBounds:bounds];
|
||||
[self updateDrawingParameter];
|
||||
[self _invalidateRendererIfNeededForBoundsSize:bounds.size];
|
||||
}
|
||||
|
||||
- (void)setBackgroundColor:(UIColor *)backgroundColor
|
||||
{
|
||||
[super setBackgroundColor:backgroundColor];
|
||||
[self updateDrawingParameter];
|
||||
}
|
||||
|
||||
#pragma mark - Renderer Management
|
||||
|
||||
- (ASTextKitRenderer *)_renderer
|
||||
@@ -435,16 +428,18 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
|
||||
#pragma mark - Drawing
|
||||
|
||||
- (void)updateDrawingParameter
|
||||
- (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> l(_textLock);
|
||||
|
||||
_drawParameter = {
|
||||
.backgroundColor = self.backgroundColor,
|
||||
.bounds = self.threadSafeBounds
|
||||
.bounds = self.bounds
|
||||
};
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)drawRect:(CGRect)bounds withParameters:(id <NSObject>)p isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing;
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> l(_textLock);
|
||||
|
||||
Reference in New Issue
Block a user