Bug 1444940 [wpt PR 9917] - Writable streams: test changes to abort() under error...
[gecko.git] / gfx / thebes / gfxPlatformMac.h
blobfd7b8ec84b5c0b1ab674c524078b830087519665
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"
13 namespace mozilla {
14 namespace gfx {
15 class DrawTarget;
16 class VsyncSource;
17 } // namespace gfx
18 } // namespace mozilla
20 class gfxPlatformMac : public gfxPlatform {
21 public:
22 gfxPlatformMac();
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;
35 gfxFontGroup*
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;
44 void
45 ReadSystemFontList(InfallibleTArray<mozilla::dom::SystemFontListEntry>*
46 aFontList) override;
48 bool IsFontFormatSupported(uint32_t aFormatFlags) override;
50 virtual void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
51 Script aRunScript,
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
56 static void
57 LookupSystemFont(mozilla::LookAndFeel::FontID aSystemFontID,
58 nsAString& aSystemFontName,
59 gfxFontStyle &aFontStyle,
60 float aDevPixPerCSSPixel);
62 virtual bool SupportsApzWheelInput() const override {
63 return true;
66 bool RespectsFontStyleSmoothing() const override {
67 // gfxMacFont respects the font smoothing hint.
68 return true;
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
74 // BasicCompositor.
75 return true;
78 virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
80 // lower threshold on font anti-aliasing
81 uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; }
83 protected:
84 bool AccelerateLayersByDefault() override;
86 BackendPrefsData GetBackendPrefs() override;
88 private:
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 */