From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- gfx/thebes/gfxPlatformMac.h | 90 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 gfx/thebes/gfxPlatformMac.h (limited to 'gfx/thebes/gfxPlatformMac.h') diff --git a/gfx/thebes/gfxPlatformMac.h b/gfx/thebes/gfxPlatformMac.h new file mode 100644 index 0000000000..f11608c03c --- /dev/null +++ b/gfx/thebes/gfxPlatformMac.h @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef GFX_PLATFORM_MAC_H +#define GFX_PLATFORM_MAC_H + +#include "nsTArrayForwardDeclare.h" +#include "gfxPlatform.h" +#include "mozilla/LookAndFeel.h" + +namespace mozilla { +namespace gfx { +class DrawTarget; +class VsyncSource; +} // namespace gfx +} // namespace mozilla + +class gfxPlatformMac : public gfxPlatform { + public: + gfxPlatformMac(); + virtual ~gfxPlatformMac(); + + static gfxPlatformMac* GetPlatform() { + return (gfxPlatformMac*)gfxPlatform::GetPlatform(); + } + + bool UsesTiling() const override; + bool ContentUsesTiling() const override; + + already_AddRefed CreateOffscreenSurface( + const IntSize& aSize, gfxImageFormat aFormat) override; + + gfxPlatformFontList* CreatePlatformFontList() override; + + void ReadSystemFontList( + nsTArray* aFontList) override; + + bool IsFontFormatSupported(uint32_t aFormatFlags) override; + + void GetCommonFallbackFonts(uint32_t aCh, Script aRunScript, + eFontPresentation aPresentation, + nsTArray& aFontList) override; + + // lookup the system font for a particular system font type and set + // the name and style characteristics + static void LookupSystemFont(mozilla::LookAndFeel::FontID aSystemFontID, + nsACString& aSystemFontName, + gfxFontStyle& aFontStyle); + + bool SupportsApzWheelInput() const override { return true; } + + bool RespectsFontStyleSmoothing() const override { + // gfxMacFont respects the font smoothing hint. + return true; + } + + bool RequiresAcceleratedGLContextForCompositorOGL() const override { + // On OS X in a VM, unaccelerated CompositorOGL shows black flashes, so we + // require accelerated GL for CompositorOGL but allow unaccelerated GL for + // BasicCompositor. + return true; + } + + already_AddRefed CreateHardwareVsyncSource() + override; + + // lower threshold on font anti-aliasing + uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; } + + protected: + bool AccelerateLayersByDefault() override; + + BackendPrefsData GetBackendPrefs() const override; + + bool CheckVariationFontSupport() override; + + void InitPlatformGPUProcessPrefs() override; + + private: + nsTArray GetPlatformCMSOutputProfileData() override; + + // read in the pref value for the lower threshold on font anti-aliasing + static uint32_t ReadAntiAliasingThreshold(); + + uint32_t mFontAntiAliasingThreshold; +}; + +#endif /* GFX_PLATFORM_MAC_H */ -- cgit v1.2.3