summaryrefslogtreecommitdiff
path: root/layout/mathml
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2022-05-28 11:45:35 -0500
committertrav90 <travawine@palemoon.org>2022-05-28 11:45:35 -0500
commit33a3173c79b1978a15ba09c70bcf744f84191626 (patch)
tree86c86313cf53f06fab79bb2b966def9f779fbe3d /layout/mathml
parent61efa1ee08354cd5294bfffaf27d48378853115a (diff)
downloaduxp-33a3173c79b1978a15ba09c70bcf744f84191626.tar.gz
Issue #457 - Remove the constructor from gfxShapedText::CompressedGlyph and make it a trivial class
Also provide a couple of convenience "factory" methods to create simple and complex glyph values.
Diffstat (limited to 'layout/mathml')
-rw-r--r--layout/mathml/nsMathMLChar.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp
index 4b02a52d8d..ad23c57bf5 100644
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -581,9 +581,9 @@ nsOpenTypeTable::MakeTextRun(DrawTarget* aDrawTarget,
aFontGroup->GetFirstValidFont()->
GetGlyphHAdvance(aDrawTarget, aGlyph.glyphID));
detailedGlyph.mXOffset = detailedGlyph.mYOffset = 0;
- gfxShapedText::CompressedGlyph g;
- g.SetComplex(true, true, 1);
- textRun->SetGlyphs(0, g, &detailedGlyph);
+ textRun->SetGlyphs(0,
+ gfxShapedText::CompressedGlyph::MakeComplex(true, true, 1),
+ &detailedGlyph);
return textRun.forget();
}
@@ -1459,7 +1459,7 @@ nsMathMLChar::StretchEnumContext::EnumCallback(const FontFamilyName& aFamily,
if (!openTypeTable) {
if (context->mTablesTried.Contains(glyphTable))
return true; // already tried this one
-
+
// Only try this table once.
context->mTablesTried.AppendElement(glyphTable);
}
@@ -1626,7 +1626,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
if (!maxWidth && !largeop) {
// Doing Stretch() not GetMaxWidth(),
// and not a largeop in display mode; we're done if size fits
- if ((targetSize <= 0) ||
+ if ((targetSize <= 0) ||
((isVertical && charSize >= targetSize) ||
IsSizeOK(charSize, targetSize, aStretchHint)))
done = true;
@@ -1678,7 +1678,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
// variables accordingly.
mUnscaledAscent = aDesiredStretchSize.ascent;
}
-
+
if (glyphFound) {
return NS_OK;
}
@@ -1695,7 +1695,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
if (!Preferences::GetBool("mathml.scale_stretchy_operators.enabled", true)) {
return NS_OK;
}
-
+
// stretchy character
if (stretchy) {
if (isVertical) {
@@ -1863,7 +1863,7 @@ public:
nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsMathMLChar* aChar,
uint32_t aIndex, bool aIsSelected)
- : nsDisplayItem(aBuilder, aFrame), mChar(aChar),
+ : nsDisplayItem(aBuilder, aFrame), mChar(aChar),
mIndex(aIndex), mIsSelected(aIsSelected) {
MOZ_COUNT_CTOR(nsDisplayMathMLCharForeground);
}
@@ -1886,7 +1886,7 @@ public:
temp.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel());
return temp;
}
-
+
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) override
{
@@ -1901,7 +1901,7 @@ public:
bool snap;
return GetBounds(aBuilder, &snap);
}
-
+
virtual uint32_t GetPerFrameKey() override {
return (mIndex << nsDisplayItem::TYPE_BITS)
| nsDisplayItem::GetPerFrameKey();
@@ -2355,7 +2355,7 @@ nsMathMLChar::PaintHorizontally(nsPresContext* aPresContext,
// _cairo_scaled_font_glyph_device_extents rounds outwards to the nearest
// pixel, so the bm values can include 1 row of faint pixels on each edge.
// Don't rely on this pixel as it can look like a gap.
- if (bm.rightBearing - bm.leftBearing >= 2 * oneDevPixel) {
+ if (bm.rightBearing - bm.leftBearing >= 2 * oneDevPixel) {
start[i] = dx + bm.leftBearing + oneDevPixel; // left join
end[i] = dx + bm.rightBearing - oneDevPixel; // right join
} else {