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"
|
|
|
|
|
2013-01-18 04:45:11 +04:00
|
|
|
class nsIMemoryReporter;
|
|
|
|
|
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>
|
2014-02-09 12:04:38 +04:00
|
|
|
CreateOffscreenSurface(const IntSize& size,
|
2013-09-25 00:45:13 +04:00
|
|
|
gfxContentType contentType);
|
2011-11-17 07:45:51 +04:00
|
|
|
|
2012-03-14 00:59:26 +04:00
|
|
|
virtual gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
|
2011-11-02 23:55:03 +04:00
|
|
|
|
2012-09-24 19:02:49 +04:00
|
|
|
mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
|
2012-07-24 14:18:37 +04:00
|
|
|
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);
|
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)
|
|
|
|
void GetFontList(InfallibleTArray<FontListEntry>* retValue);
|
2011-09-23 13:36:16 +04:00
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
// platform implementations of font functions
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags);
|
2010-07-16 10:03:45 +04:00
|
|
|
virtual gfxPlatformFontList* CreatePlatformFontList();
|
2014-09-08 11:23:19 +04:00
|
|
|
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
|
|
|
uint16_t aWeight,
|
|
|
|
int16_t aStretch,
|
|
|
|
bool aItalic);
|
|
|
|
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
|
|
|
uint16_t aWeight,
|
|
|
|
int16_t aStretch,
|
|
|
|
bool aItalic,
|
|
|
|
const uint8_t* aFontData,
|
|
|
|
uint32_t aLength);
|
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,
|
2013-03-04 21:03:16 +04:00
|
|
|
int32_t aRunScript,
|
|
|
|
nsTArray<const char*>& aFontList);
|
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
virtual nsresult GetFontList(nsIAtom *aLangGroup,
|
|
|
|
const nsACString& aGenericFamily,
|
|
|
|
nsTArray<nsString>& aListOfFonts);
|
2010-05-11 21:27:36 +04:00
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
virtual nsresult UpdateFontList();
|
2010-05-11 21:27:36 +04:00
|
|
|
|
2011-09-23 15:15:36 +04:00
|
|
|
virtual nsresult GetStandardFamilyName(const nsAString& aFontName,
|
|
|
|
nsAString& aFamilyName);
|
2010-05-11 21:27:36 +04:00
|
|
|
|
2014-06-06 10:09:23 +04:00
|
|
|
virtual gfxFontGroup*
|
|
|
|
CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
|
|
|
|
const gfxFontStyle *aStyle,
|
|
|
|
gfxUserFontSet* aUserFontSet);
|
2010-05-11 21:27:36 +04:00
|
|
|
|
2012-02-09 02:52:57 +04:00
|
|
|
virtual bool FontHintingEnabled() MOZ_OVERRIDE;
|
2013-01-15 19:19:28 +04:00
|
|
|
virtual bool RequiresLinearZoom() MOZ_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
|
|
|
|
2012-05-15 23:41:20 +04:00
|
|
|
virtual int GetScreenDepth() const;
|
|
|
|
|
2014-09-15 02:22:44 +04:00
|
|
|
virtual bool CanRenderContentToDataSurface() const MOZ_OVERRIDE {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-11 00:15:43 +04:00
|
|
|
virtual bool HaveChoiceOfHWAndSWCanvas() MOZ_OVERRIDE;
|
2014-03-06 01:48:58 +04:00
|
|
|
virtual bool UseAcceleratedSkiaCanvas() MOZ_OVERRIDE;
|
2014-12-18 19:30:06 +03:00
|
|
|
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() MOZ_OVERRIDE;
|
|
|
|
|
2014-03-06 01:48:58 +04:00
|
|
|
|
2014-04-01 17:33:49 +04:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
virtual bool IsInGonkEmulator() const { return mIsInGonkEmulator; }
|
|
|
|
#endif
|
|
|
|
|
2012-03-14 00:59:26 +04:00
|
|
|
private:
|
2012-05-15 23:41:20 +04:00
|
|
|
int mScreenDepth;
|
2012-03-14 00:59:26 +04:00
|
|
|
gfxImageFormat mOffscreenFormat;
|
2014-04-01 17:33:49 +04:00
|
|
|
|
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
bool mIsInGonkEmulator;
|
|
|
|
#endif
|
2010-05-11 21:27:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_PLATFORM_ANDROID_H */
|
|
|
|
|