1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/thebes/gfxPlatformMac.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,90 @@ 1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef GFX_PLATFORM_MAC_H 1.10 +#define GFX_PLATFORM_MAC_H 1.11 + 1.12 +#include "nsTArrayForwardDeclare.h" 1.13 +#include "gfxPlatform.h" 1.14 + 1.15 +#define MAC_OS_X_VERSION_10_6_HEX 0x00001060 1.16 +#define MAC_OS_X_VERSION_10_7_HEX 0x00001070 1.17 + 1.18 +#define MAC_OS_X_MAJOR_VERSION_MASK 0xFFFFFFF0U 1.19 + 1.20 +namespace mozilla { namespace gfx { class DrawTarget; }} 1.21 + 1.22 +class gfxPlatformMac : public gfxPlatform { 1.23 +public: 1.24 + gfxPlatformMac(); 1.25 + virtual ~gfxPlatformMac(); 1.26 + 1.27 + static gfxPlatformMac *GetPlatform() { 1.28 + return (gfxPlatformMac*) gfxPlatform::GetPlatform(); 1.29 + } 1.30 + 1.31 + virtual already_AddRefed<gfxASurface> 1.32 + CreateOffscreenSurface(const IntSize& size, 1.33 + gfxContentType contentType) MOZ_OVERRIDE; 1.34 + 1.35 + virtual already_AddRefed<gfxASurface> 1.36 + CreateOffscreenImageSurface(const gfxIntSize& aSize, 1.37 + gfxContentType aContentType); 1.38 + 1.39 + already_AddRefed<gfxASurface> OptimizeImage(gfxImageSurface *aSurface, 1.40 + gfxImageFormat format); 1.41 + 1.42 + mozilla::TemporaryRef<mozilla::gfx::ScaledFont> 1.43 + GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont); 1.44 + 1.45 + nsresult ResolveFontName(const nsAString& aFontName, 1.46 + FontResolverCallback aCallback, 1.47 + void *aClosure, bool& aAborted); 1.48 + 1.49 + nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName); 1.50 + 1.51 + gfxFontGroup *CreateFontGroup(const nsAString &aFamilies, 1.52 + const gfxFontStyle *aStyle, 1.53 + gfxUserFontSet *aUserFontSet); 1.54 + 1.55 + virtual gfxFontEntry* LookupLocalFont(const gfxProxyFontEntry *aProxyEntry, 1.56 + const nsAString& aFontName); 1.57 + 1.58 + virtual gfxPlatformFontList* CreatePlatformFontList(); 1.59 + 1.60 + virtual gfxFontEntry* MakePlatformFont(const gfxProxyFontEntry *aProxyEntry, 1.61 + const uint8_t *aFontData, 1.62 + uint32_t aLength); 1.63 + 1.64 + bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags); 1.65 + 1.66 + nsresult GetFontList(nsIAtom *aLangGroup, 1.67 + const nsACString& aGenericFamily, 1.68 + nsTArray<nsString>& aListOfFonts); 1.69 + nsresult UpdateFontList(); 1.70 + 1.71 + virtual void GetCommonFallbackFonts(const uint32_t aCh, 1.72 + int32_t aRunScript, 1.73 + nsTArray<const char*>& aFontList); 1.74 + 1.75 + bool UseAcceleratedCanvas(); 1.76 + 1.77 + // lower threshold on font anti-aliasing 1.78 + uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; } 1.79 + 1.80 + virtual already_AddRefed<gfxASurface> 1.81 + GetThebesSurfaceForDrawTarget(mozilla::gfx::DrawTarget *aTarget); 1.82 +private: 1.83 + virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size); 1.84 + 1.85 + virtual bool SupportsOffMainThreadCompositing(); 1.86 + 1.87 + // read in the pref value for the lower threshold on font anti-aliasing 1.88 + static uint32_t ReadAntiAliasingThreshold(); 1.89 + 1.90 + uint32_t mFontAntiAliasingThreshold; 1.91 +}; 1.92 + 1.93 +#endif /* GFX_PLATFORM_MAC_H */