Bug 1593339 - Remove now-unused vibrancy fill color methods. r=spohl

Differential Revision: https://phabricator.services.mozilla.com/D51457

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-11-05 18:47:17 +00:00
parent 5586cc9eca
commit 691e7d64a1
4 changed files with 0 additions and 57 deletions

View File

@ -75,14 +75,6 @@ class VibrancyManager {
LayoutDeviceIntRegion GetUnionOfVibrantRegions() const;
/**
* Return the fill color that should be drawn on top of the cleared window
* parts. Usually this would be drawn by -[NSVisualEffectView drawRect:].
* The returned color is opaque if the system-wide "Reduce transparency"
* preference is set.
*/
NSColor* VibrancyFillColorForType(VibrancyType aType);
/**
* Check whether the operating system supports vibrancy at all.
* You may only create a VibrancyManager instance if this returns true.

View File

@ -31,32 +31,6 @@ LayoutDeviceIntRegion VibrancyManager::GetUnionOfVibrantRegions() const {
return result;
}
@interface NSView (CurrentFillColor)
- (NSColor*)_currentFillColor;
@end
static NSColor* AdjustedColor(NSColor* aFillColor, VibrancyType aType) {
if (aType == VibrancyType::MENU && [aFillColor alphaComponent] == 1.0) {
// The opaque fill color that's used for the menu background when "Reduce
// vibrancy" is checked in the system accessibility prefs is too dark.
// This is probably because we're not using the right material for menus,
// see VibrancyManager::CreateEffectView.
return [NSColor colorWithDeviceWhite:0.96 alpha:1.0];
}
return aFillColor;
}
NSColor* VibrancyManager::VibrancyFillColorForType(VibrancyType aType) {
NSView* view = mVibrantRegions.LookupOrAdd(uint32_t(aType))->GetAnyView();
if (view && [view respondsToSelector:@selector(_currentFillColor)]) {
// -[NSVisualEffectView _currentFillColor] is the color that the view
// draws in its drawRect implementation.
return AdjustedColor([view _currentFillColor], aType);
}
return [NSColor whiteColor];
}
static NSView* HitTestNil(id self, SEL _cmd, NSPoint aPoint) {
// This view must be transparent to mouse events.
return nil;

View File

@ -280,8 +280,6 @@ class WidgetRenderingContext;
- (void)viewWillStartLiveResize;
- (void)viewDidEndLiveResize;
- (NSColor*)vibrancyFillColorForThemeGeometryType:(nsITheme::ThemeGeometryType)aThemeGeometryType;
/*
* Gestures support
*
@ -526,10 +524,6 @@ class nsChildView final : public nsBaseWidget {
mozilla::widget::TextInputHandler* GetTextInputHandler() { return mTextInputHandler; }
NSColor* VibrancyFillColorForThemeGeometryType(nsITheme::ThemeGeometryType aThemeGeometryType);
NSColor* VibrancyFontSmoothingBackgroundColorForThemeGeometryType(
nsITheme::ThemeGeometryType aThemeGeometryType);
// unit conversion convenience functions
int32_t CocoaPointsToDevPixels(CGFloat aPts) const {
return nsCocoaUtils::CocoaPointsToDevPixels(aPts, BackingScaleFactor());

View File

@ -2468,16 +2468,6 @@ void nsChildView::UpdateVibrancy(const nsTArray<ThemeGeometry>& aThemeGeometries
}
}
NSColor* nsChildView::VibrancyFillColorForThemeGeometryType(
nsITheme::ThemeGeometryType aThemeGeometryType) {
if (VibrancyManager::SystemSupportsVibrancy()) {
Maybe<VibrancyType> vibrancyType = ThemeGeometryTypeToVibrancyType(aThemeGeometryType);
MOZ_RELEASE_ASSERT(vibrancyType, "should only encounter vibrant theme geometry types here");
return EnsureVibrancyManager().VibrancyFillColorForType(*vibrancyType);
}
return [NSColor whiteColor];
}
mozilla::VibrancyManager& nsChildView::EnsureVibrancyManager() {
MOZ_ASSERT(mView, "Only call this once we have a view!");
if (!mVibrancyManager) {
@ -3445,13 +3435,6 @@ NSEvent* gLastDragMouseDownEvent = nil; // [strong]
}
}
- (NSColor*)vibrancyFillColorForThemeGeometryType:(nsITheme::ThemeGeometryType)aThemeGeometryType {
if (!mGeckoChild) {
return [NSColor whiteColor];
}
return mGeckoChild->VibrancyFillColorForThemeGeometryType(aThemeGeometryType);
}
- (LayoutDeviceIntRegion)nativeDirtyRegionWithBoundingRect:(NSRect)aRect {
MOZ_RELEASE_ASSERT(!StaticPrefs::gfx_core_animation_enabled_AtStartup());