Changeset 233075 in webkit
- Timestamp:
- Jun 22, 2018 2:49:55 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r233066 r233075 1 2018-06-22 Miguel Gomez <magomez@igalia.com> 2 3 [WPE][ThreadedRendering] WPE crashes rendering some pieces of text when using ThreadedRendering 4 https://bugs.webkit.org/show_bug.cgi?id=186886 5 6 Reviewed by Žan Doberšek. 7 8 Modify DisplayList DrawGlyphs element to use a GraphicsContext for replaying. To do so, modify 9 GraphicsContext::drawGlyphs() API so it doesn't require a FontCascade, and update all the calls 10 to it. 11 12 Covered by existent tests. 13 14 * platform/graphics/FontCascade.cpp: 15 (WebCore::FontCascade::drawGlyphBuffer const): 16 * platform/graphics/GraphicsContext.cpp: 17 (WebCore::GraphicsContext::drawGlyphs): 18 * platform/graphics/GraphicsContext.h: 19 * platform/graphics/displaylists/DisplayListItems.cpp: 20 (WebCore::DisplayList::DrawGlyphs::apply const): 21 * rendering/mathml/MathOperator.cpp: 22 (WebCore::MathOperator::paintGlyph): 23 (WebCore::MathOperator::paint): 24 * rendering/mathml/RenderMathMLToken.cpp: 25 (WebCore::RenderMathMLToken::paint): 26 1 27 2018-06-15 Jer Noble <jer.noble@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r232175 r233075 1431 1431 if (nextFontData != fontData || nextOffset != offset) { 1432 1432 if (shouldDrawIfLoading(*fontData, customFontNotReadyAction)) 1433 context.drawGlyphs(* this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);1433 context.drawGlyphs(*fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, m_fontDescription.fontSmoothing()); 1434 1434 1435 1435 lastFrom = nextGlyph; … … 1445 1445 1446 1446 if (shouldDrawIfLoading(*fontData, customFontNotReadyAction)) 1447 context.drawGlyphs(* this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);1447 context.drawGlyphs(*fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, m_fontDescription.fontSmoothing()); 1448 1448 point.setX(nextX); 1449 1449 } -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r232246 r233075 641 641 } 642 642 643 void GraphicsContext::drawGlyphs(const Font Cascade& fontCascade, const Font& font, const GlyphBuffer& buffer, unsigned from, unsigned numGlyphs, const FloatPoint& point)644 { 645 if (paintingDisabled()) 646 return; 647 648 if (m_impl) { 649 m_impl->drawGlyphs(font, buffer, from, numGlyphs, point, font Cascade.fontDescription().fontSmoothing());650 return; 651 } 652 653 fontCascade.drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing());643 void GraphicsContext::drawGlyphs(const Font& font, const GlyphBuffer& buffer, unsigned from, unsigned numGlyphs, const FloatPoint& point, FontSmoothingMode fontSmoothingMode) 644 { 645 if (paintingDisabled()) 646 return; 647 648 if (m_impl) { 649 m_impl->drawGlyphs(font, buffer, from, numGlyphs, point, fontSmoothingMode); 650 return; 651 } 652 653 FontCascade::drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontSmoothingMode); 654 654 } 655 655 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r232246 r233075 397 397 398 398 float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt); 399 void drawGlyphs(const Font Cascade&, const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&);399 void drawGlyphs(const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, FontSmoothingMode); 400 400 void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt); 401 401 void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady); -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
r222610 r233075 372 372 void DrawGlyphs::apply(GraphicsContext& context) const 373 373 { 374 FontCascade::drawGlyphs(context,m_font, generateGlyphBuffer(), 0, m_glyphs.size(), anchorPoint(), m_smoothingMode);374 context.drawGlyphs(m_font, generateGlyphBuffer(), 0, m_glyphs.size(), anchorPoint(), m_smoothingMode); 375 375 } 376 376 -
trunk/Source/WebCore/rendering/mathml/MathOperator.cpp
r232178 r233075 540 540 GlyphBuffer buffer; 541 541 buffer.add(data.glyph, data.font, advanceWidthForGlyph(data)); 542 info.context().drawGlyphs( style.fontCascade(), *data.font, buffer, 0, 1, origin);542 info.context().drawGlyphs(*data.font, buffer, 0, 1, origin, style.fontCascade().fontDescription().fontSmoothing()); 543 543 544 544 return glyphPaintRect; … … 747 747 FloatRect glyphBounds = boundsForGlyph(glyphData); 748 748 LayoutPoint operatorOrigin(operatorTopLeft.x(), operatorTopLeft.y() - glyphBounds.y()); 749 paintInfo.context().drawGlyphs( style.fontCascade(), *glyphData.font, buffer, 0, 1, operatorOrigin);749 paintInfo.context().drawGlyphs(*glyphData.font, buffer, 0, 1, operatorOrigin, style.fontCascade().fontDescription().fontSmoothing()); 750 750 } 751 751 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
r232178 r233075 608 608 buffer.add(mathVariantGlyph.glyph, mathVariantGlyph.font, mathVariantGlyph.font->widthForGlyph(mathVariantGlyph.glyph)); 609 609 LayoutUnit glyphAscent = static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y())); 610 info.context().drawGlyphs( style().fontCascade(), *mathVariantGlyph.font, buffer, 0, 1, paintOffset + location() + LayoutPoint(0, glyphAscent));610 info.context().drawGlyphs(*mathVariantGlyph.font, buffer, 0, 1, paintOffset + location() + LayoutPoint(0, glyphAscent), style().fontCascade().fontDescription().fontSmoothing()); 611 611 } 612 612
Note: See TracChangeset
for help on using the changeset viewer.