2010-05-11 17:27:36 +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/. */
|
2010-05-11 17:27:36 +00:00
|
|
|
|
|
|
|
#ifndef GFX_PLATFORM_ANDROID_H
|
|
|
|
#define GFX_PLATFORM_ANDROID_H
|
|
|
|
|
|
|
|
#include "gfxFT2Fonts.h"
|
|
|
|
#include "gfxPlatform.h"
|
2011-09-23 11:15:36 +00:00
|
|
|
#include "gfxUserFontSet.h"
|
2010-05-11 17:27:36 +00:00
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2011-09-23 11:16:13 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class FontListEntry;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
using mozilla::dom::FontListEntry;
|
|
|
|
|
2010-05-11 17:27:36 +00:00
|
|
|
typedef struct FT_LibraryRec_ *FT_Library;
|
|
|
|
|
2013-05-29 21:59:24 +00:00
|
|
|
class gfxAndroidPlatform : public gfxPlatform {
|
2010-05-11 17:27:36 +00:00
|
|
|
public:
|
|
|
|
gfxAndroidPlatform();
|
|
|
|
virtual ~gfxAndroidPlatform();
|
|
|
|
|
|
|
|
static gfxAndroidPlatform *GetPlatform() {
|
|
|
|
return (gfxAndroidPlatform*) gfxPlatform::GetPlatform();
|
|
|
|
}
|
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
virtual already_AddRefed<gfxASurface>
|
|
|
|
CreateOffscreenSurface(const gfxIntSize& size,
|
|
|
|
gfxASurface::gfxContentType contentType);
|
2011-11-17 03:45:51 +00:00
|
|
|
|
2012-03-13 20:59:26 +00:00
|
|
|
virtual gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
|
2011-11-02 19:55:03 +00:00
|
|
|
|
2012-09-24 15:02:49 +00:00
|
|
|
mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
|
2012-07-24 10:18:37 +00:00
|
|
|
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);
|
2010-05-11 17:27:36 +00:00
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
// to support IPC font list (sharing between chrome and content)
|
|
|
|
void GetFontList(InfallibleTArray<FontListEntry>* retValue);
|
2011-09-23 09:36:16 +00:00
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
// platform implementations of font functions
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags);
|
2010-07-16 06:03:45 +00:00
|
|
|
virtual gfxPlatformFontList* CreatePlatformFontList();
|
|
|
|
virtual gfxFontEntry* MakePlatformFont(const gfxProxyFontEntry *aProxyEntry,
|
2012-08-22 15:56:38 +00:00
|
|
|
const uint8_t *aFontData, uint32_t aLength);
|
2010-07-16 06:03:45 +00:00
|
|
|
|
2013-03-04 17:03:16 +00:00
|
|
|
virtual void GetCommonFallbackFonts(const uint32_t aCh,
|
|
|
|
int32_t aRunScript,
|
|
|
|
nsTArray<const char*>& aFontList);
|
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
virtual nsresult GetFontList(nsIAtom *aLangGroup,
|
|
|
|
const nsACString& aGenericFamily,
|
|
|
|
nsTArray<nsString>& aListOfFonts);
|
2010-05-11 17:27:36 +00:00
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
virtual nsresult UpdateFontList();
|
2010-05-11 17:27:36 +00:00
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
virtual nsresult ResolveFontName(const nsAString& aFontName,
|
|
|
|
FontResolverCallback aCallback,
|
2011-09-29 06:19:26 +00:00
|
|
|
void *aClosure, bool& aAborted);
|
2010-05-11 17:27:36 +00:00
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
virtual nsresult GetStandardFamilyName(const nsAString& aFontName,
|
|
|
|
nsAString& aFamilyName);
|
2010-05-11 17:27:36 +00:00
|
|
|
|
2011-09-23 11:15:36 +00:00
|
|
|
virtual gfxFontGroup *CreateFontGroup(const nsAString &aFamilies,
|
|
|
|
const gfxFontStyle *aStyle,
|
|
|
|
gfxUserFontSet* aUserFontSet);
|
2010-05-11 17:27:36 +00:00
|
|
|
|
2012-02-08 22:52:57 +00:00
|
|
|
virtual bool FontHintingEnabled() MOZ_OVERRIDE;
|
2013-01-15 15:19:28 +00:00
|
|
|
virtual bool RequiresLinearZoom() MOZ_OVERRIDE;
|
2012-02-08 22:52:57 +00:00
|
|
|
|
2010-05-11 17:27:36 +00:00
|
|
|
FT_Library GetFTLibrary();
|
2012-03-13 20:59:26 +00:00
|
|
|
|
2012-05-15 19:41:20 +00:00
|
|
|
virtual int GetScreenDepth() const;
|
|
|
|
|
2012-03-13 20:59:26 +00:00
|
|
|
private:
|
2012-05-15 19:41:20 +00:00
|
|
|
int mScreenDepth;
|
2012-03-13 20:59:26 +00:00
|
|
|
gfxImageFormat mOffscreenFormat;
|
2010-05-11 17:27:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_PLATFORM_ANDROID_H */
|
|
|
|
|