Bug 1355612 - Make WrGlyphInstance hold a Point2D instead of raw x/y to match the Rust side. r=jrmuizel

MozReview-Commit-ID: 7OtctQ4gWyv
This commit is contained in:
Kartikaya Gupta 2017-04-11 18:00:50 -04:00
Родитель 8050498fed
Коммит db665d693b
2 изменённых файлов: 5 добавлений и 6 удалений

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

@ -197,8 +197,8 @@ WebRenderBridgeChild::PushGlyphs(wr::DisplayListBuilder& aBuilder, const nsTArra
for (size_t j = 0; j < glyphs.Length(); j++) {
wr_glyph_instances[j].index = glyphs[j].mIndex;
wr_glyph_instances[j].x = glyphs[j].mPosition.x - aOffset.x;
wr_glyph_instances[j].y = glyphs[j].mPosition.y - aOffset.y;
wr_glyph_instances[j].point.x = glyphs[j].mPosition.x - aOffset.x;
wr_glyph_instances[j].point.y = glyphs[j].mPosition.y - aOffset.y;
}
aBuilder.PushText(wr::ToWrRect(aBounds),
clipRegion,

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

@ -181,6 +181,7 @@ enum class WrRepeatMode : uint32_t
// -----
typedef uint64_t WrExternalImageId;
typedef mozilla::gfx::Point Point2D; // TODO: get rid of this somehow
// -----
// Structs used in C++ code with corresponding types in Rust code
@ -262,14 +263,12 @@ struct WrColor
struct WrGlyphInstance
{
uint32_t index;
float x;
float y;
Point2D point;
bool operator==(const WrGlyphInstance& other) const
{
return index == other.index &&
x == other.x &&
y == other.y;
point == other.point;
}
};