зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
5161c570ac
Коммит
903d4af62b
12
gfx/2d/2D.h
12
gfx/2d/2D.h
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче