Bug 1489127. WebRender: Re-generate FFI header

This commit is contained in:
Jeff Muizelaar 2018-09-07 10:00:09 -04:00
Родитель c7d5869aa3
Коммит af3661ea41
1 изменённых файлов: 108 добавлений и 88 удалений

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

@ -272,6 +272,18 @@ struct IdNamespace {
}
};
struct FontInstanceKey {
IdNamespace mNamespace;
uint32_t mHandle;
bool operator==(const FontInstanceKey& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};
using WrFontInstanceKey = FontInstanceKey;
struct FontKey {
IdNamespace mNamespace;
uint32_t mHandle;
@ -284,6 +296,92 @@ struct FontKey {
using WrFontKey = FontKey;
// Represents RGBA screen colors with one byte per channel.
//
// If the alpha value `a` is 255 the color is opaque.
struct ColorU {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
bool operator==(const ColorU& aOther) const {
return r == aOther.r &&
g == aOther.g &&
b == aOther.b &&
a == aOther.a;
}
};
struct SyntheticItalics {
int16_t angle;
bool operator==(const SyntheticItalics& aOther) const {
return angle == aOther.angle;
}
};
struct FontInstanceOptions {
FontRenderMode render_mode;
FontInstanceFlags flags;
// When bg_color.a is != 0 and render_mode is FontRenderMode::Subpixel,
// the text will be rendered with bg_color.r/g/b as an opaque estimated
// background color.
ColorU bg_color;
SyntheticItalics synthetic_italics;
bool operator==(const FontInstanceOptions& aOther) const {
return render_mode == aOther.render_mode &&
flags == aOther.flags &&
bg_color == aOther.bg_color &&
synthetic_italics == aOther.synthetic_italics;
}
};
#if defined(XP_WIN)
struct FontInstancePlatformOptions {
uint16_t gamma;
uint16_t contrast;
bool operator==(const FontInstancePlatformOptions& aOther) const {
return gamma == aOther.gamma &&
contrast == aOther.contrast;
}
};
#endif
#if defined(XP_MACOSX)
struct FontInstancePlatformOptions {
uint32_t unused;
bool operator==(const FontInstancePlatformOptions& aOther) const {
return unused == aOther.unused;
}
};
#endif
#if !(defined(XP_MACOSX) || defined(XP_WIN))
struct FontInstancePlatformOptions {
FontLCDFilter lcd_filter;
FontHinting hinting;
bool operator==(const FontInstancePlatformOptions& aOther) const {
return lcd_filter == aOther.lcd_filter &&
hinting == aOther.hinting;
}
};
#endif
struct FontVariation {
uint32_t tag;
float value;
bool operator==(const FontVariation& aOther) const {
return tag == aOther.tag &&
value == aOther.value;
}
};
using VecU8 = Vec<uint8_t>;
using ArcVecU8 = Arc<VecU8>;
@ -751,18 +849,6 @@ union GlyphRasterSpace {
}
};
struct FontInstanceKey {
IdNamespace mNamespace;
uint32_t mHandle;
bool operator==(const FontInstanceKey& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};
using WrFontInstanceKey = FontInstanceKey;
using GlyphIndex = uint32_t;
struct GlyphInstance {
@ -881,82 +967,6 @@ struct WrImageDescriptor {
}
};
// Represents RGBA screen colors with one byte per channel.
//
// If the alpha value `a` is 255 the color is opaque.
struct ColorU {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
bool operator==(const ColorU& aOther) const {
return r == aOther.r &&
g == aOther.g &&
b == aOther.b &&
a == aOther.a;
}
};
struct SyntheticItalics {
int16_t angle;
bool operator==(const SyntheticItalics& aOther) const {
return angle == aOther.angle;
}
};
struct FontInstanceOptions {
FontRenderMode render_mode;
FontInstanceFlags flags;
// When bg_color.a is != 0 and render_mode is FontRenderMode::Subpixel,
// the text will be rendered with bg_color.r/g/b as an opaque estimated
// background color.
ColorU bg_color;
SyntheticItalics synthetic_italics;
bool operator==(const FontInstanceOptions& aOther) const {
return render_mode == aOther.render_mode &&
flags == aOther.flags &&
bg_color == aOther.bg_color &&
synthetic_italics == aOther.synthetic_italics;
}
};
#if defined(XP_WIN)
struct FontInstancePlatformOptions {
uint16_t gamma;
uint16_t contrast;
bool operator==(const FontInstancePlatformOptions& aOther) const {
return gamma == aOther.gamma &&
contrast == aOther.contrast;
}
};
#endif
#if defined(XP_MACOSX)
struct FontInstancePlatformOptions {
uint32_t unused;
bool operator==(const FontInstancePlatformOptions& aOther) const {
return unused == aOther.unused;
}
};
#endif
#if !(defined(XP_MACOSX) || defined(XP_WIN))
struct FontInstancePlatformOptions {
FontLCDFilter lcd_filter;
FontHinting hinting;
bool operator==(const FontInstancePlatformOptions& aOther) const {
return lcd_filter == aOther.lcd_filter &&
hinting == aOther.hinting;
}
};
#endif
using NormalizedRect = TypedRect<float, NormalizedCoordinates>;
struct WrTransformProperty {
@ -976,6 +986,14 @@ struct WrOpacityProperty {
extern "C" {
extern void AddBlobFont(WrFontInstanceKey aInstanceKey,
WrFontKey aFontKey,
float aSize,
const FontInstanceOptions *aOptions,
const FontInstancePlatformOptions *aPlatformOptions,
const FontVariation *aVariations,
uintptr_t aNumVariations);
extern void AddFontData(WrFontKey aKey,
const uint8_t *aData,
uintptr_t aSize,
@ -988,6 +1006,8 @@ extern void AddNativeFontHandle(WrFontKey aKey,
extern void ClearBlobImageResources(WrIdNamespace aNamespace);
extern void DeleteBlobFont(WrFontInstanceKey aKey);
extern void DeleteFontData(WrFontKey aKey);
extern void apz_deregister_sampler(WrWindowId aWindowId);