Bug 1291457 - Remove shadow invalidation code. r=spohl

Invalidating a window's shadow is really slow and leads to flickering. Now that
arrow panels don't change their contents during the panel opening animation any
more, their shape stays the same after the first paint, so we don't need the
shadow invalidation functionality for them any more. And as far as I know, we
don't use transparent popups with changing shapes anywhere else.
The system still computes the shadow for the first paint of the window (which
happens during the orderFront call), and it updates the shadow whenever the
window resizes. But not when its size stays the same and only what we draw in
the content is updated.

MozReview-Commit-ID: 138PjbrSFrc

--HG--
extra : rebase_source : fed1c653ca3d88ef8b4e8e55a7d42b29e17a1624
This commit is contained in:
Markus Stange 2016-08-02 16:39:06 -04:00
Родитель 7dbdf64f91
Коммит 2c241960ec
3 изменённых файлов: 0 добавлений и 27 удалений

Просмотреть файл

@ -3767,12 +3767,6 @@ NSEvent* gLastDragMouseDownEvent = nil;
{
CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
[self drawRect:aRect inContext:cgContext];
// If we're a transparent window and our contents have changed, we need
// to make sure the shadow is updated to the new contents.
if ([[self window] isKindOfClass:[BaseWindow class]]) {
[(BaseWindow*)[self window] deferredInvalidateShadow];
}
}
- (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext

Просмотреть файл

@ -41,9 +41,6 @@ typedef struct _nsCocoaWindowList {
NSColor* mActiveTitlebarColor;
NSColor* mInactiveTitlebarColor;
// Shadow
BOOL mScheduledShadowInvalidation;
// Invalidation disabling
BOOL mDisabledNeedsDisplay;
@ -69,8 +66,6 @@ typedef struct _nsCocoaWindowList {
- (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive;
- (NSColor*)titlebarColorForActiveWindow:(BOOL)aActive;
- (void)deferredInvalidateShadow;
- (void)invalidateShadow;
- (float)getDPI;
- (void)mouseEntered:(NSEvent*)aEvent;

Просмотреть файл

@ -3000,7 +3000,6 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil;
mState = nil;
mActiveTitlebarColor = nil;
mInactiveTitlebarColor = nil;
mScheduledShadowInvalidation = NO;
mDisabledNeedsDisplay = NO;
mDPI = GetDPI(self);
mTrackingArea = nil;
@ -3150,21 +3149,6 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
return aActive ? mActiveTitlebarColor : mInactiveTitlebarColor;
}
- (void)deferredInvalidateShadow
{
if (mScheduledShadowInvalidation || [self isOpaque] || ![self hasShadow])
return;
[self performSelector:@selector(invalidateShadow) withObject:nil afterDelay:0];
mScheduledShadowInvalidation = YES;
}
- (void)invalidateShadow
{
[super invalidateShadow];
mScheduledShadowInvalidation = NO;
}
- (float)getDPI
{
return mDPI;