gfx/thebes/gfxPlatformMac.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef GFX_PLATFORM_MAC_H
michael@0 7 #define GFX_PLATFORM_MAC_H
michael@0 8
michael@0 9 #include "nsTArrayForwardDeclare.h"
michael@0 10 #include "gfxPlatform.h"
michael@0 11
michael@0 12 #define MAC_OS_X_VERSION_10_6_HEX 0x00001060
michael@0 13 #define MAC_OS_X_VERSION_10_7_HEX 0x00001070
michael@0 14
michael@0 15 #define MAC_OS_X_MAJOR_VERSION_MASK 0xFFFFFFF0U
michael@0 16
michael@0 17 namespace mozilla { namespace gfx { class DrawTarget; }}
michael@0 18
michael@0 19 class gfxPlatformMac : public gfxPlatform {
michael@0 20 public:
michael@0 21 gfxPlatformMac();
michael@0 22 virtual ~gfxPlatformMac();
michael@0 23
michael@0 24 static gfxPlatformMac *GetPlatform() {
michael@0 25 return (gfxPlatformMac*) gfxPlatform::GetPlatform();
michael@0 26 }
michael@0 27
michael@0 28 virtual already_AddRefed<gfxASurface>
michael@0 29 CreateOffscreenSurface(const IntSize& size,
michael@0 30 gfxContentType contentType) MOZ_OVERRIDE;
michael@0 31
michael@0 32 virtual already_AddRefed<gfxASurface>
michael@0 33 CreateOffscreenImageSurface(const gfxIntSize& aSize,
michael@0 34 gfxContentType aContentType);
michael@0 35
michael@0 36 already_AddRefed<gfxASurface> OptimizeImage(gfxImageSurface *aSurface,
michael@0 37 gfxImageFormat format);
michael@0 38
michael@0 39 mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
michael@0 40 GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);
michael@0 41
michael@0 42 nsresult ResolveFontName(const nsAString& aFontName,
michael@0 43 FontResolverCallback aCallback,
michael@0 44 void *aClosure, bool& aAborted);
michael@0 45
michael@0 46 nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
michael@0 47
michael@0 48 gfxFontGroup *CreateFontGroup(const nsAString &aFamilies,
michael@0 49 const gfxFontStyle *aStyle,
michael@0 50 gfxUserFontSet *aUserFontSet);
michael@0 51
michael@0 52 virtual gfxFontEntry* LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
michael@0 53 const nsAString& aFontName);
michael@0 54
michael@0 55 virtual gfxPlatformFontList* CreatePlatformFontList();
michael@0 56
michael@0 57 virtual gfxFontEntry* MakePlatformFont(const gfxProxyFontEntry *aProxyEntry,
michael@0 58 const uint8_t *aFontData,
michael@0 59 uint32_t aLength);
michael@0 60
michael@0 61 bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags);
michael@0 62
michael@0 63 nsresult GetFontList(nsIAtom *aLangGroup,
michael@0 64 const nsACString& aGenericFamily,
michael@0 65 nsTArray<nsString>& aListOfFonts);
michael@0 66 nsresult UpdateFontList();
michael@0 67
michael@0 68 virtual void GetCommonFallbackFonts(const uint32_t aCh,
michael@0 69 int32_t aRunScript,
michael@0 70 nsTArray<const char*>& aFontList);
michael@0 71
michael@0 72 bool UseAcceleratedCanvas();
michael@0 73
michael@0 74 // lower threshold on font anti-aliasing
michael@0 75 uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; }
michael@0 76
michael@0 77 virtual already_AddRefed<gfxASurface>
michael@0 78 GetThebesSurfaceForDrawTarget(mozilla::gfx::DrawTarget *aTarget);
michael@0 79 private:
michael@0 80 virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size);
michael@0 81
michael@0 82 virtual bool SupportsOffMainThreadCompositing();
michael@0 83
michael@0 84 // read in the pref value for the lower threshold on font anti-aliasing
michael@0 85 static uint32_t ReadAntiAliasingThreshold();
michael@0 86
michael@0 87 uint32_t mFontAntiAliasingThreshold;
michael@0 88 };
michael@0 89
michael@0 90 #endif /* GFX_PLATFORM_MAC_H */

mercurial