2006-02-22 01:44:31 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-02-22 01:44:31 +00:00
|
|
|
|
|
|
|
#ifndef GFX_PLATFORM_MAC_H
|
|
|
|
#define GFX_PLATFORM_MAC_H
|
|
|
|
|
2013-10-07 23:15:59 +00:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
2006-02-22 01:44:31 +00:00
|
|
|
#include "gfxPlatform.h"
|
|
|
|
|
2014-12-18 16:30:06 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
class DrawTarget;
|
|
|
|
class VsyncSource;
|
|
|
|
} // gfx
|
|
|
|
} // mozilla
|
2009-03-30 00:31:51 +00:00
|
|
|
|
2013-05-29 21:59:24 +00:00
|
|
|
class gfxPlatformMac : public gfxPlatform {
|
2006-02-22 01:44:31 +00:00
|
|
|
public:
|
|
|
|
gfxPlatformMac();
|
2009-03-30 00:31:51 +00:00
|
|
|
virtual ~gfxPlatformMac();
|
2006-02-22 01:44:31 +00:00
|
|
|
|
|
|
|
static gfxPlatformMac *GetPlatform() {
|
|
|
|
return (gfxPlatformMac*) gfxPlatform::GetPlatform();
|
|
|
|
}
|
|
|
|
|
2014-02-09 08:04:38 +00:00
|
|
|
virtual already_AddRefed<gfxASurface>
|
|
|
|
CreateOffscreenSurface(const IntSize& size,
|
|
|
|
gfxContentType contentType) MOZ_OVERRIDE;
|
|
|
|
|
2012-09-24 15:02:49 +00:00
|
|
|
mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
|
2015-01-06 20:12:41 +00:00
|
|
|
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) MOZ_OVERRIDE;
|
2011-11-18 04:00:38 +00:00
|
|
|
|
2015-01-06 20:12:41 +00:00
|
|
|
nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName) MOZ_OVERRIDE;
|
2008-03-13 10:32:50 +00:00
|
|
|
|
2014-06-06 06:09:23 +00:00
|
|
|
gfxFontGroup*
|
|
|
|
CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
|
|
|
|
const gfxFontStyle *aStyle,
|
2015-01-06 20:12:41 +00:00
|
|
|
gfxUserFontSet *aUserFontSet) MOZ_OVERRIDE;
|
2008-10-01 03:01:53 +00:00
|
|
|
|
2014-09-08 07:23:19 +00:00
|
|
|
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
|
|
|
uint16_t aWeight,
|
|
|
|
int16_t aStretch,
|
2015-01-06 20:12:41 +00:00
|
|
|
bool aItalic) MOZ_OVERRIDE;
|
2008-10-01 03:01:53 +00:00
|
|
|
|
2015-01-06 20:12:41 +00:00
|
|
|
virtual gfxPlatformFontList* CreatePlatformFontList() MOZ_OVERRIDE;
|
2009-08-16 13:52:12 +00:00
|
|
|
|
2014-09-08 07:23:19 +00:00
|
|
|
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
|
|
|
uint16_t aWeight,
|
|
|
|
int16_t aStretch,
|
|
|
|
bool aItalic,
|
|
|
|
const uint8_t* aFontData,
|
2015-01-06 20:12:41 +00:00
|
|
|
uint32_t aLength) MOZ_OVERRIDE;
|
2008-10-01 03:01:53 +00:00
|
|
|
|
2015-01-06 20:12:41 +00:00
|
|
|
bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags) MOZ_OVERRIDE;
|
2006-11-22 00:52:09 +00:00
|
|
|
|
2010-02-24 17:57:57 +00:00
|
|
|
nsresult GetFontList(nsIAtom *aLangGroup,
|
2006-11-22 00:52:09 +00:00
|
|
|
const nsACString& aGenericFamily,
|
2015-01-06 20:12:41 +00:00
|
|
|
nsTArray<nsString>& aListOfFonts) MOZ_OVERRIDE;
|
|
|
|
nsresult UpdateFontList() MOZ_OVERRIDE;
|
2007-07-23 22:02:17 +00:00
|
|
|
|
2014-09-30 06:27:55 +00:00
|
|
|
virtual void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aRunScript,
|
2015-01-06 20:12:41 +00:00
|
|
|
nsTArray<const char*>& aFontList) MOZ_OVERRIDE;
|
2012-03-09 02:05:24 +00:00
|
|
|
|
2014-09-14 22:22:44 +00:00
|
|
|
virtual bool CanRenderContentToDataSurface() const MOZ_OVERRIDE {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-31 15:17:43 +00:00
|
|
|
bool UseAcceleratedCanvas();
|
|
|
|
|
2014-11-07 19:17:14 +00:00
|
|
|
virtual bool UseProgressivePaint() MOZ_OVERRIDE;
|
2014-12-18 16:30:06 +00:00
|
|
|
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() MOZ_OVERRIDE;
|
2014-07-25 00:49:45 +00:00
|
|
|
|
2008-05-01 09:07:17 +00:00
|
|
|
// lower threshold on font anti-aliasing
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; }
|
2009-03-30 00:31:51 +00:00
|
|
|
|
2007-07-23 22:02:17 +00:00
|
|
|
private:
|
2015-01-06 20:12:41 +00:00
|
|
|
virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size) MOZ_OVERRIDE;
|
2013-03-28 20:11:58 +00:00
|
|
|
|
2008-05-01 09:07:17 +00:00
|
|
|
// read in the pref value for the lower threshold on font anti-aliasing
|
2013-03-28 20:11:58 +00:00
|
|
|
static uint32_t ReadAntiAliasingThreshold();
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mFontAntiAliasingThreshold;
|
2006-02-22 01:44:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_PLATFORM_MAC_H */
|