зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1533562 - Remove synchronous repaint capability of setTitlebarNeedsDisplayInRect:sync: and also remove the rect parameter because we always pass the same value to it. r=spohl
The synchronous paint was only needed a long time ago when we were calling this method during drawRect. We're not doing that any more, we usually call it from viewWillDraw now. But even at the time, forcing a synchronous paint *within* a paint was extremely sketchy, so best just to remove the code. Differential Revision: https://phabricator.services.mozilla.com/D22642 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5a16846aa3
Коммит
7540dfbeba
|
@ -170,8 +170,7 @@ typedef struct _nsCocoaWindowList {
|
|||
- (CGFloat)unifiedToolbarHeight;
|
||||
- (CGFloat)titlebarHeight;
|
||||
- (NSRect)titlebarRect;
|
||||
- (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect sync:(BOOL)aSync;
|
||||
- (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect;
|
||||
- (void)setTitlebarNeedsDisplay;
|
||||
- (void)setDrawsContentsIntoWindowFrame:(BOOL)aState;
|
||||
- (void)setSheetAttachmentPosition:(CGFloat)aY;
|
||||
- (CGFloat)sheetAttachmentPosition;
|
||||
|
|
|
@ -3181,23 +3181,14 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
- (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect {
|
||||
[self setTitlebarNeedsDisplayInRect:aRect sync:NO];
|
||||
}
|
||||
|
||||
- (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect sync:(BOOL)aSync {
|
||||
NSRect titlebarRect = [self titlebarRect];
|
||||
NSRect rect = NSIntersectionRect(titlebarRect, aRect);
|
||||
- (void)setTitlebarNeedsDisplay {
|
||||
NSRect rect = [self titlebarRect];
|
||||
if (NSIsEmptyRect(rect)) return;
|
||||
|
||||
NSView* borderView = [[self contentView] superview];
|
||||
if (!borderView) return;
|
||||
|
||||
if (aSync) {
|
||||
[borderView displayRect:rect];
|
||||
} else {
|
||||
[borderView setNeedsDisplayInRect:rect];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSRect)titlebarRect {
|
||||
|
@ -3228,10 +3219,7 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
|
|||
mUnifiedToolbarHeight = aHeight;
|
||||
|
||||
if (![self drawsContentsIntoWindowFrame]) {
|
||||
// Redraw the title bar. If we're inside painting, we'll do it right now,
|
||||
// otherwise we'll just invalidate it.
|
||||
BOOL needSyncRedraw = ([NSView focusView] != nil);
|
||||
[self setTitlebarNeedsDisplayInRect:[self titlebarRect] sync:needSyncRedraw];
|
||||
[self setTitlebarNeedsDisplay];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3263,7 +3251,7 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
|
|||
|
||||
- (void)setWantsTitleDrawn:(BOOL)aDrawTitle {
|
||||
[super setWantsTitleDrawn:aDrawTitle];
|
||||
[self setTitlebarNeedsDisplayInRect:[self titlebarRect]];
|
||||
[self setTitlebarNeedsDisplay];
|
||||
}
|
||||
|
||||
- (void)setSheetAttachmentPosition:(CGFloat)aY {
|
||||
|
|
Загрузка…
Ссылка в новой задаче