Ticket #16221: 32BitGlyph.diff

File 32BitGlyph.diff, 3.5 KB (added by pulkomandy, 3 years ago)
  • Source/WebCore/platform/graphics/GlyphBufferMembers.h

    diff --git a/Source/WebCore/platform/graphics/GlyphBufferMembers.h b/Source/WebCore/platform/graphics/GlyphBufferMembers.h
    index 9723d1cf2584..a2b254d7eb15 100644
    a b using GlyphBufferAdvance = CGSize;  
    4949using GlyphBufferOrigin = CGPoint;
    5050using GlyphBufferStringOffset = CFIndex;
    5151#else
     52#if USE(HAIKU)
     53// The Haiku port uses unicode codepoints as glyphs directly, and need a 32bit
     54// type to store them
     55using GlyphBufferGlyph = uint32_t;
     56#else
    5257using GlyphBufferGlyph = Glyph;
     58#endif
    5359using GlyphBufferAdvance = FloatSize;
    5460using GlyphBufferOrigin = FloatPoint;
    5561using GlyphBufferStringOffset = unsigned;
  • Source/WebCore/rendering/mathml/MathOperator.cpp

    diff --git a/Source/WebCore/rendering/mathml/MathOperator.cpp b/Source/WebCore/rendering/mathml/MathOperator.cpp
    index 1d287766621e..0b746265735f 100644
    a b LayoutRect MathOperator::paintGlyph(const RenderStyle& style, PaintInfo& info, c  
    526526
    527527    // FIXME: If we're just drawing a single glyph, why do we need to compute an advance?
    528528    auto advance = makeGlyphBufferAdvance(advanceWidthForGlyph(data));
    529     info.context().drawGlyphs(*data.font, &data.glyph, &advance, 1, origin, style.fontCascade().fontDescription().fontSmoothing());
     529    info.context().drawGlyphs(*data.font, (GlyphBufferGlyph*)&data.glyph, &advance, 1, origin, style.fontCascade().fontDescription().fontSmoothing());
    530530
    531531    return glyphPaintRect;
    532532}
    void MathOperator::paint(const RenderStyle& style, PaintInfo& info, const Layout  
    733733    LayoutPoint operatorOrigin { operatorTopLeft.x(), LayoutUnit(operatorTopLeft.y() - glyphBounds.y()) };
    734734    // FIXME: If we're just drawing a single glyph, why do we need to compute an advance?
    735735    auto advance = makeGlyphBufferAdvance(advanceWidthForGlyph(glyphData));
    736     paintInfo.context().drawGlyphs(*glyphData.font, &glyphData.glyph, &advance, 1, operatorOrigin, style.fontCascade().fontDescription().fontSmoothing());
     736    paintInfo.context().drawGlyphs(*glyphData.font, (GlyphBufferGlyph*)&glyphData.glyph, &advance, 1, operatorOrigin, style.fontCascade().fontDescription().fontSmoothing());
    737737}
    738738
    739739}
  • Source/WebCore/rendering/mathml/RenderMathMLToken.cpp

    diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
    index 7cc9b7d41624..4351d077c5e8 100644
    a b void RenderMathMLToken::paint(PaintInfo& info, const LayoutPoint& paintOffset)  
    609609    LayoutUnit glyphAscent = static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y()));
    610610    // FIXME: If we're just drawing a single glyph, why do we need to compute an advance?
    611611    auto advance = makeGlyphBufferAdvance(mathVariantGlyph.font->widthForGlyph(mathVariantGlyph.glyph));
    612     info.context().drawGlyphs(*mathVariantGlyph.font, &mathVariantGlyph.glyph, &advance, 1, paintOffset + location() + LayoutPoint(0_lu, glyphAscent), style().fontCascade().fontDescription().fontSmoothing());
     612    info.context().drawGlyphs(*mathVariantGlyph.font, (GlyphBufferGlyph*)&mathVariantGlyph.glyph, &advance, 1, paintOffset + location() + LayoutPoint(0_lu, glyphAscent), style().fontCascade().fontDescription().fontSmoothing());
    613613}
    614614
    615615void RenderMathMLToken::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOffset, PaintInfo& paintInfoForChild, bool usePrintRect)