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