1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_PLATFORM_MAC_H
7 #define GFX_PLATFORM_MAC_H
9 #include "nsTArrayForwardDeclare.h"
10 #include "gfxPlatform.h"
11 #include "mozilla/LookAndFeel.h"
18 } // namespace mozilla
20 class gfxPlatformMac
: public gfxPlatform
{
23 virtual ~gfxPlatformMac();
25 static gfxPlatformMac
*GetPlatform() {
26 return (gfxPlatformMac
*) gfxPlatform::GetPlatform();
29 bool UsesTiling() const override
;
31 virtual already_AddRefed
<gfxASurface
>
32 CreateOffscreenSurface(const IntSize
& aSize
,
33 gfxImageFormat aFormat
) override
;
36 CreateFontGroup(const mozilla::FontFamilyList
& aFontFamilyList
,
37 const gfxFontStyle
*aStyle
,
38 gfxTextPerfMetrics
* aTextPerf
,
39 gfxUserFontSet
*aUserFontSet
,
40 gfxFloat aDevToCssSize
) override
;
42 virtual gfxPlatformFontList
* CreatePlatformFontList() override
;
45 ReadSystemFontList(InfallibleTArray
<mozilla::dom::SystemFontListEntry
>*
48 bool IsFontFormatSupported(uint32_t aFormatFlags
) override
;
50 virtual void GetCommonFallbackFonts(uint32_t aCh
, uint32_t aNextCh
,
52 nsTArray
<const char*>& aFontList
) override
;
54 // lookup the system font for a particular system font type and set
55 // the name and style characteristics
57 LookupSystemFont(mozilla::LookAndFeel::FontID aSystemFontID
,
58 nsAString
& aSystemFontName
,
59 gfxFontStyle
&aFontStyle
,
60 float aDevPixPerCSSPixel
);
62 virtual bool SupportsApzWheelInput() const override
{
66 bool RespectsFontStyleSmoothing() const override
{
67 // gfxMacFont respects the font smoothing hint.
71 bool RequiresAcceleratedGLContextForCompositorOGL() const override
{
72 // On OS X in a VM, unaccelerated CompositorOGL shows black flashes, so we
73 // require accelerated GL for CompositorOGL but allow unaccelerated GL for
78 virtual already_AddRefed
<mozilla::gfx::VsyncSource
> CreateHardwareVsyncSource() override
;
80 // lower threshold on font anti-aliasing
81 uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold
; }
84 bool AccelerateLayersByDefault() override
;
86 BackendPrefsData
GetBackendPrefs() override
;
89 virtual void GetPlatformCMSOutputProfile(void* &mem
, size_t &size
) override
;
91 // read in the pref value for the lower threshold on font anti-aliasing
92 static uint32_t ReadAntiAliasingThreshold();
94 uint32_t mFontAntiAliasingThreshold
;
97 #endif /* GFX_PLATFORM_MAC_H */