2010-05-11 21:27:36 +04: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/. */
|
2010-05-11 21:27:36 +04:00
|
|
|
|
|
|
|
#ifndef GFX_PLATFORM_ANDROID_H
|
|
|
|
#define GFX_PLATFORM_ANDROID_H
|
|
|
|
|
|
|
|
#include "gfxFT2Fonts.h"
|
|
|
|
#include "gfxPlatform.h"
|
2011-09-23 15:15:36 +04:00
|
|
|
#include "gfxUserFontSet.h"
|
2013-01-18 04:45:11 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2010-05-11 21:27:36 +04:00
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2011-09-23 15:16:13 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class FontListEntry;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using mozilla::dom::FontListEntry;
|
|
|
|
|
2010-05-11 21:27:36 +04:00
|
|
|
typedef struct FT_LibraryRec_ *FT_Library;
|
|
|
|
|
2013-05-30 01:59:24 +04:00
|
|
|
class gfxAndroidPlatform : public gfxPlatform {
|
2010-05-11 21:27:36 +04:00
|
|
|
public:
|
|
|
|
gfxAndroidPlatform();
|
|
|
|
virtual ~gfxAndroidPlatform();
|
|
|
|
|
|
|
|
static gfxAndroidPlatform *GetPlatform() {
|
|
|
|
return (gfxAndroidPlatform*) gfxPlatform::GetPlatform();
|
|
|
|
}
|
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
virtual already_AddRefed<gfxASurface>
|
2015-07-07 04:21:47 +03:00
|
|
|
CreateOffscreenSurface(const IntSize& aSize,
|
2016-06-04 01:31:05 +03:00
|
|
|
gfxImageFormat aFormat) override;
|
2011-11-17 07:45:51 +04:00
|
|
|
|
2016-06-04 01:31:05 +03:00
|
|
|
virtual gfxImageFormat GetOffscreenFormat() override { return mOffscreenFormat; }
|
2011-11-02 23:55:03 +04:00
|
|
|
|
2015-06-17 17:00:52 +03:00
|
|
|
already_AddRefed<mozilla::gfx::ScaledFont>
|
2016-06-04 01:31:05 +03:00
|
|
|
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) override;
|
2010-05-11 21:27:36 +04:00
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
// to support IPC font list (sharing between chrome and content)
|
2015-05-13 08:11:25 +03:00
|
|
|
void GetSystemFontList(InfallibleTArray<FontListEntry>* retValue);
|
2011-09-23 13:36:16 +04:00
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
// platform implementations of font functions
|
2016-06-04 01:31:05 +03:00
|
|
|
virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags) override;
|
|
|
|
virtual gfxPlatformFontList* CreatePlatformFontList() override;
|
2010-07-16 10:03:45 +04:00
|
|
|
|
2014-09-30 10:27:55 +04:00
|
|
|
virtual void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
|
2016-04-21 20:58:59 +03:00
|
|
|
Script aRunScript,
|
2016-06-04 01:31:05 +03:00
|
|
|
nsTArray<const char*>& aFontList) override;
|
2013-03-04 21:03:16 +04:00
|
|
|
|
2015-09-11 07:24:33 +03:00
|
|
|
gfxFontGroup*
|
2014-06-06 10:09:23 +04:00
|
|
|
CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
|
|
|
|
const gfxFontStyle *aStyle,
|
2015-09-11 07:24:33 +03:00
|
|
|
gfxTextPerfMetrics* aTextPerf,
|
2015-11-20 16:01:12 +03:00
|
|
|
gfxUserFontSet *aUserFontSet,
|
|
|
|
gfxFloat aDevToCssSize) override;
|
2010-05-11 21:27:36 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool FontHintingEnabled() override;
|
|
|
|
virtual bool RequiresLinearZoom() override;
|
2012-02-09 02:52:57 +04:00
|
|
|
|
2010-05-11 21:27:36 +04:00
|
|
|
FT_Library GetFTLibrary();
|
2012-03-14 00:59:26 +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-03-21 19:28:04 +03:00
|
|
|
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
|
2014-12-18 19:30:06 +03:00
|
|
|
|
2015-04-20 00:34:09 +03:00
|
|
|
virtual bool SupportsApzTouchInput() const override {
|
2015-03-25 01:04:44 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-07-17 01:18:05 +03:00
|
|
|
protected:
|
|
|
|
bool AccelerateLayersByDefault() override {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-03-14 00:59:26 +04:00
|
|
|
private:
|
|
|
|
gfxImageFormat mOffscreenFormat;
|
2010-05-11 21:27:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_PLATFORM_ANDROID_H */
|
|
|
|
|