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