michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_PLATFORM_MAC_H michael@0: #define GFX_PLATFORM_MAC_H michael@0: michael@0: #include "nsTArrayForwardDeclare.h" michael@0: #include "gfxPlatform.h" michael@0: michael@0: #define MAC_OS_X_VERSION_10_6_HEX 0x00001060 michael@0: #define MAC_OS_X_VERSION_10_7_HEX 0x00001070 michael@0: michael@0: #define MAC_OS_X_MAJOR_VERSION_MASK 0xFFFFFFF0U michael@0: michael@0: namespace mozilla { namespace gfx { class DrawTarget; }} michael@0: michael@0: class gfxPlatformMac : public gfxPlatform { michael@0: public: michael@0: gfxPlatformMac(); michael@0: virtual ~gfxPlatformMac(); michael@0: michael@0: static gfxPlatformMac *GetPlatform() { michael@0: return (gfxPlatformMac*) gfxPlatform::GetPlatform(); michael@0: } michael@0: michael@0: virtual already_AddRefed michael@0: CreateOffscreenSurface(const IntSize& size, michael@0: gfxContentType contentType) MOZ_OVERRIDE; michael@0: michael@0: virtual already_AddRefed michael@0: CreateOffscreenImageSurface(const gfxIntSize& aSize, michael@0: gfxContentType aContentType); michael@0: michael@0: already_AddRefed OptimizeImage(gfxImageSurface *aSurface, michael@0: gfxImageFormat format); michael@0: michael@0: mozilla::TemporaryRef michael@0: GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont); michael@0: michael@0: nsresult ResolveFontName(const nsAString& aFontName, michael@0: FontResolverCallback aCallback, michael@0: void *aClosure, bool& aAborted); michael@0: michael@0: nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName); michael@0: michael@0: gfxFontGroup *CreateFontGroup(const nsAString &aFamilies, michael@0: const gfxFontStyle *aStyle, michael@0: gfxUserFontSet *aUserFontSet); michael@0: michael@0: virtual gfxFontEntry* LookupLocalFont(const gfxProxyFontEntry *aProxyEntry, michael@0: const nsAString& aFontName); michael@0: michael@0: virtual gfxPlatformFontList* CreatePlatformFontList(); michael@0: michael@0: virtual gfxFontEntry* MakePlatformFont(const gfxProxyFontEntry *aProxyEntry, michael@0: const uint8_t *aFontData, michael@0: uint32_t aLength); michael@0: michael@0: bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags); michael@0: michael@0: nsresult GetFontList(nsIAtom *aLangGroup, michael@0: const nsACString& aGenericFamily, michael@0: nsTArray& aListOfFonts); michael@0: nsresult UpdateFontList(); michael@0: michael@0: virtual void GetCommonFallbackFonts(const uint32_t aCh, michael@0: int32_t aRunScript, michael@0: nsTArray& aFontList); michael@0: michael@0: bool UseAcceleratedCanvas(); michael@0: michael@0: // lower threshold on font anti-aliasing michael@0: uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; } michael@0: michael@0: virtual already_AddRefed michael@0: GetThebesSurfaceForDrawTarget(mozilla::gfx::DrawTarget *aTarget); michael@0: private: michael@0: virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size); michael@0: michael@0: virtual bool SupportsOffMainThreadCompositing(); michael@0: michael@0: // read in the pref value for the lower threshold on font anti-aliasing michael@0: static uint32_t ReadAntiAliasingThreshold(); michael@0: michael@0: uint32_t mFontAntiAliasingThreshold; michael@0: }; michael@0: michael@0: #endif /* GFX_PLATFORM_MAC_H */