зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1533562 - Remove code that deals with non-rounded bottom corners on regular windows. r=spohl
Rounded bottom corners have been the default since 10.7. Differential Revision: https://phabricator.services.mozilla.com/D22643 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c0aa023eb0
Коммит
467f5af7ba
|
@ -601,7 +601,6 @@ class nsChildView final : public nsBaseWidget {
|
|||
// by mEffectsLock.
|
||||
bool mShowsResizeIndicator;
|
||||
LayoutDeviceIntRect mResizeIndicatorRect;
|
||||
bool mHasRoundedBottomCorners;
|
||||
int mDevPixelCornerRadius;
|
||||
bool mIsCoveringTitlebar;
|
||||
bool mIsFullscreen;
|
||||
|
|
|
@ -186,7 +186,6 @@ static NSMutableDictionary* sNativeKeyEventsMap = [NSMutableDictionary dictionar
|
|||
- (LayoutDeviceIntRegion)nativeDirtyRegionWithBoundingRect:(NSRect)aRect;
|
||||
- (BOOL)isUsingOpenGL;
|
||||
|
||||
- (BOOL)hasRoundedBottomCorners;
|
||||
- (CGFloat)cornerRadius;
|
||||
- (void)clearCorners;
|
||||
|
||||
|
@ -324,7 +323,6 @@ nsChildView::nsChildView()
|
|||
mViewTearDownLock("ChildViewTearDown"),
|
||||
mEffectsLock("WidgetEffects"),
|
||||
mShowsResizeIndicator(false),
|
||||
mHasRoundedBottomCorners(false),
|
||||
mDevPixelCornerRadius{0},
|
||||
mIsCoveringTitlebar(false),
|
||||
mIsFullscreen(false),
|
||||
|
@ -1741,7 +1739,6 @@ void nsChildView::PrepareWindowEffects() {
|
|||
{
|
||||
MutexAutoLock lock(mEffectsLock);
|
||||
mShowsResizeIndicator = ShowsResizeIndicator(&mResizeIndicatorRect);
|
||||
mHasRoundedBottomCorners = [mView hasRoundedBottomCorners];
|
||||
CGFloat cornerRadius = [mView cornerRadius];
|
||||
mDevPixelCornerRadius = cornerRadius * BackingScaleFactor();
|
||||
mIsCoveringTitlebar = [mView isCoveringTitlebar];
|
||||
|
@ -2134,7 +2131,7 @@ void nsChildView::MaybeDrawRoundedCorners(GLManager* aManager, const LayoutDevic
|
|||
mCornerMaskImage->Draw(aManager, aRect.TopRight(), flipX);
|
||||
}
|
||||
|
||||
if (mHasRoundedBottomCorners && !mIsFullscreen) {
|
||||
if (!mIsFullscreen) {
|
||||
// Mask the bottom corners.
|
||||
mCornerMaskImage->Draw(aManager, aRect.BottomLeft(), flipY);
|
||||
mCornerMaskImage->Draw(aManager, aRect.BottomRight(), flipY * flipX);
|
||||
|
@ -3342,11 +3339,6 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||
return mGLContext || mUsingOMTCompositor;
|
||||
}
|
||||
|
||||
- (BOOL)hasRoundedBottomCorners {
|
||||
return [[self window] respondsToSelector:@selector(bottomCornerRounded)] &&
|
||||
[[self window] bottomCornerRounded];
|
||||
}
|
||||
|
||||
- (CGFloat)cornerRadius {
|
||||
NSView* frameView = [[[self window] contentView] superview];
|
||||
if (!frameView || ![frameView respondsToSelector:@selector(roundedCornerRadius)]) return 4.0f;
|
||||
|
@ -3389,15 +3381,13 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||
NSRectFill(NSMakeRect(w - radius, 0, radius, radius));
|
||||
}
|
||||
|
||||
if ([self hasRoundedBottomCorners]) {
|
||||
NSRectFill(NSMakeRect(0, h - radius, radius, radius));
|
||||
NSRectFill(NSMakeRect(w - radius, h - radius, radius, radius));
|
||||
}
|
||||
NSRectFill(NSMakeRect(0, h - radius, radius, radius));
|
||||
NSRectFill(NSMakeRect(w - radius, h - radius, radius, radius));
|
||||
}
|
||||
|
||||
// This is the analog of nsChildView::MaybeDrawRoundedCorners for CGContexts.
|
||||
// We only need to mask the top corners here because Cocoa does the masking
|
||||
// for the window's bottom corners automatically (starting with 10.7).
|
||||
// for the window's bottom corners automatically.
|
||||
- (void)maskTopCornersInContext:(CGContextRef)aContext {
|
||||
CGFloat radius = [self cornerRadius];
|
||||
int32_t devPixelCornerRadius = mGeckoChild->CocoaPointsToDevPixels(radius);
|
||||
|
|
|
@ -99,13 +99,6 @@ typedef struct _nsCocoaWindowList {
|
|||
// original value.
|
||||
- (void)_setWindowNumber:(NSInteger)aNumber;
|
||||
|
||||
// If we set the window's stylemask to be textured, the corners on the bottom of
|
||||
// the window are rounded by default. We use this private method to make
|
||||
// the corners square again, a la Safari. Starting with 10.7, all windows have
|
||||
// rounded bottom corners, so this call doesn't have any effect there.
|
||||
- (void)setBottomCornerRounded:(BOOL)rounded;
|
||||
- (BOOL)bottomCornerRounded;
|
||||
|
||||
// Present in the same form on OS X since at least OS X 10.5.
|
||||
- (NSRect)contentRectForFrameRect:(NSRect)windowFrame styleMask:(NSUInteger)windowStyle;
|
||||
- (NSRect)frameRectForContentRect:(NSRect)windowContentRect styleMask:(NSUInteger)windowStyle;
|
||||
|
|
|
@ -3170,11 +3170,6 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
|
|||
mSheetAttachmentPosition = aContentRect.size.height;
|
||||
mWindowButtonsRect = NSZeroRect;
|
||||
mFullScreenButtonRect = NSZeroRect;
|
||||
|
||||
// setBottomCornerRounded: is a private API call, so we check to make sure
|
||||
// we respond to it just in case.
|
||||
if ([self respondsToSelector:@selector(setBottomCornerRounded:)])
|
||||
[self setBottomCornerRounded:YES];
|
||||
}
|
||||
return self;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче