Bug 1397458 - part 3 - add ScaledFont::GetWRFontInstanceOptions for querying WebRender font instance options r=kats

MozReview-Commit-ID: BRDfmwkbOY2

--HG--
extra : rebase_source : 9a11342a28354cac43490df4d1b3ffb0e327dc67
This commit is contained in:
Lee Salzman 2017-09-19 23:11:02 -04:00
Родитель 5161c570ac
Коммит 903d4af62b
3 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -72,6 +72,11 @@ namespace mozilla {
class Mutex;
namespace wr {
struct FontInstanceOptions;
struct FontInstancePlatformOptions;
}
namespace gfx {
class UnscaledFont;
class ScaledFont;
@ -828,6 +833,13 @@ public:
virtual bool GetFontInstanceData(FontInstanceDataOutput, void *) { return false; }
virtual bool GetWRFontInstanceOptions(Maybe<wr::FontInstanceOptions>* aOutOptions,
Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
std::vector<FontVariation>* aOutVariations)
{
return false;
}
virtual bool CanSerialize() { return false; }
void AddUserData(UserDataKey *key, void *userData, void (*destroy)(void*)) {

Просмотреть файл

@ -358,6 +358,17 @@ ScaledFontMac::GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton)
return true;
}
bool
ScaledFontMac::GetWRFontInstanceOptions(Maybe<wr::FontInstanceOptions>* aOutOptions,
Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
std::vector<FontVariation>* aOutVariations)
{
if (!GetVariationsForCTFont(mCTFont, aOutVariations)) {
return false;
}
return true;
}
static CFDictionaryRef
CreateVariationDictionaryOrNull(CGFontRef aCGFont, uint32_t aVariationCount,
const FontVariation* aVariations)

Просмотреть файл

@ -52,6 +52,10 @@ public:
bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override;
bool GetWRFontInstanceOptions(Maybe<wr::FontInstanceOptions>* aOutOptions,
Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
std::vector<FontVariation>* aOutVariations) override;
bool CanSerialize() override { return true; }
#ifdef USE_CAIRO_SCALED_FONT