Remove caching of _drawParameter and use bounds instead of threadSafeBounds

This commit is contained in:
Michael Schneider
2016-06-20 16:41:42 -07:00
parent 74b9b6b49e
commit 36e48cf340
2 changed files with 5 additions and 10 deletions

View File

@@ -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,

View File

@@ -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);