Issue #1667 - Part 2: Add MacOS 11.0 Big Sur widget compatibility

This involves refactoring the vibrancy and OpenGL/Pixel rendering changes contained
in the following Mozilla meta bugs: 1496823 and 1491445
Also add Big Sur to the features tests and update popup menu look and feel based
on Mozilla bug 1656301.
This commit is contained in:
Brian Smith 2020-11-16 07:23:44 -06:00 committed by roytam1
commit de885df033
10 changed files with 286 additions and 609 deletions

View file

@ -76,14 +76,6 @@ public:
bool HasVibrantRegions() { return !mVibrantRegions.IsEmpty(); }
/**
* Clear the vibrant areas that we know about.
* The clearing happens in the current NSGraphicsContext. If you call this
* from within an -[NSView drawRect:] implementation, the currrent
* NSGraphicsContext is already correctly set to the window drawing context.
*/
void ClearVibrantAreas() const;
/**
* Return the fill color that should be drawn on top of the cleared window
* parts. Usually this would be drawn by -[NSVisualEffectView drawRect:].
@ -105,10 +97,19 @@ public:
*/
static bool SystemSupportsVibrancy();
protected:
void ClearVibrantRegion(const LayoutDeviceIntRegion& aVibrantRegion) const;
NSView* CreateEffectView(VibrancyType aType);
/**
* Create an NSVisualEffectView for the specified vibrancy type. The return
* value is not autoreleased. We return an object of type NSView* because we
* compile with an SDK that does not contain a definition for
* NSVisualEffectView.
* @param aIsContainer Whether this NSView will have child views. This value
* affects hit testing: Container views will pass through
* hit testing requests to their children, and leaf views
* will be transparent to hit testing.
*/
static NSView* CreateEffectView(VibrancyType aType, BOOL aIsContainer = NO);
protected:
const nsChildView& mCoordinateConverter;
NSView* mContainerView;
nsClassHashtable<nsUint32HashKey, ViewRegion> mVibrantRegions;