WebKit Bugzilla
Attachment 343313 Details for
Bug 186886
: [WPE][ThreadedRendering] WPE crashes rendering some pieces of text when using ThreadedRendering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186886-20180622100343.patch (text/plain), 8.62 KB, created by
Miguel Gomez
on 2018-06-22 01:03:45 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Miguel Gomez
Created:
2018-06-22 01:03:45 PDT
Size:
8.62 KB
patch
obsolete
>Subversion Revision: 233072 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 56f26de3cb463a463c1327b6749b5edbc66b7c07..25497b0f6ad2c8bae0f72111ec7124f3cbd9450c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2018-06-22 Miguel Gomez <magomez@igalia.com> >+ >+ [WPE][ThreadedRendering] WPE crashes rendering some pieces of text when using ThreadedRendering >+ https://bugs.webkit.org/show_bug.cgi?id=186886 >+ >+ Reviewed by Žan Doberšek. >+ >+ Modify DisplayList DrawGlyphs element to use a GraphicsContext for replaying. To do so, modify >+ GraphicsContext::drawGlyphs() API so it doesn't require a FontCascade, and update all the calls >+ to it. >+ >+ Covered by existent tests. >+ >+ * platform/graphics/FontCascade.cpp: >+ (WebCore::FontCascade::drawGlyphBuffer const): >+ * platform/graphics/GraphicsContext.cpp: >+ (WebCore::GraphicsContext::drawGlyphs): >+ * platform/graphics/GraphicsContext.h: >+ * platform/graphics/displaylists/DisplayListItems.cpp: >+ (WebCore::DisplayList::DrawGlyphs::apply const): >+ * rendering/mathml/MathOperator.cpp: >+ (WebCore::MathOperator::paintGlyph): >+ (WebCore::MathOperator::paint): >+ * rendering/mathml/RenderMathMLToken.cpp: >+ (WebCore::RenderMathMLToken::paint): >+ > 2018-06-15 Jer Noble <jer.noble@apple.com> > > Address fullscreen api CSS env feedback >diff --git a/Source/WebCore/platform/graphics/FontCascade.cpp b/Source/WebCore/platform/graphics/FontCascade.cpp >index bfbcb837d1c7a314c5fa41ef4d7007ec253a995e..79c9aa6298f1154ea8538bee3f597f9743a6385c 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.cpp >+++ b/Source/WebCore/platform/graphics/FontCascade.cpp >@@ -1430,7 +1430,7 @@ void FontCascade::drawGlyphBuffer(GraphicsContext& context, const GlyphBuffer& g > > if (nextFontData != fontData || nextOffset != offset) { > if (shouldDrawIfLoading(*fontData, customFontNotReadyAction)) >- context.drawGlyphs(*this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint); >+ context.drawGlyphs(*fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, m_fontDescription.fontSmoothing()); > > lastFrom = nextGlyph; > fontData = nextFontData; >@@ -1444,7 +1444,7 @@ void FontCascade::drawGlyphBuffer(GraphicsContext& context, const GlyphBuffer& g > } > > if (shouldDrawIfLoading(*fontData, customFontNotReadyAction)) >- context.drawGlyphs(*this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint); >+ context.drawGlyphs(*fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, m_fontDescription.fontSmoothing()); > point.setX(nextX); > } > >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp >index bc3b651c4578a5fb2bc51f2425956cda22a3a5ad..1e0f2b8c7e251c88c07a38686c20b32b6eafed80 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp >@@ -640,17 +640,17 @@ float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, con > return font.drawText(*this, run, point, from, to); > } > >-void GraphicsContext::drawGlyphs(const FontCascade& fontCascade, const Font& font, const GlyphBuffer& buffer, unsigned from, unsigned numGlyphs, const FloatPoint& point) >+void GraphicsContext::drawGlyphs(const Font& font, const GlyphBuffer& buffer, unsigned from, unsigned numGlyphs, const FloatPoint& point, FontSmoothingMode fontSmoothingMode) > { > if (paintingDisabled()) > return; > > if (m_impl) { >- m_impl->drawGlyphs(font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing()); >+ m_impl->drawGlyphs(font, buffer, from, numGlyphs, point, fontSmoothingMode); > return; > } > >- fontCascade.drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing()); >+ FontCascade::drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontSmoothingMode); > } > > void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, std::optional<unsigned> to) >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index 61112a093dc726422c2b9b8403756251fc3ec71f..40a9691fb641764792bd4cb803e77b230ab9fa47 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -396,7 +396,7 @@ public: > TextDrawingModeFlags textDrawingMode() const { return m_state.textDrawingMode; } > > float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt); >- void drawGlyphs(const FontCascade&, const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&); >+ void drawGlyphs(const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, FontSmoothingMode); > void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt); > void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady); > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >index e88c44836049d4a043fafec9ce017b042be79219..1fcee8b384373036d23f09112ab63e79695ec043 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >@@ -371,7 +371,7 @@ inline GlyphBuffer DrawGlyphs::generateGlyphBuffer() const > > void DrawGlyphs::apply(GraphicsContext& context) const > { >- FontCascade::drawGlyphs(context, m_font, generateGlyphBuffer(), 0, m_glyphs.size(), anchorPoint(), m_smoothingMode); >+ context.drawGlyphs(m_font, generateGlyphBuffer(), 0, m_glyphs.size(), anchorPoint(), m_smoothingMode); > } > > void DrawGlyphs::computeBounds() >diff --git a/Source/WebCore/rendering/mathml/MathOperator.cpp b/Source/WebCore/rendering/mathml/MathOperator.cpp >index 83544fd68689579f9e5d4d0ec617d5576708d7d8..85e02a4568168b6f63ec2fb1425edecfa051a604 100644 >--- a/Source/WebCore/rendering/mathml/MathOperator.cpp >+++ b/Source/WebCore/rendering/mathml/MathOperator.cpp >@@ -539,7 +539,7 @@ LayoutRect MathOperator::paintGlyph(const RenderStyle& style, PaintInfo& info, c > > GlyphBuffer buffer; > buffer.add(data.glyph, data.font, advanceWidthForGlyph(data)); >- info.context().drawGlyphs(style.fontCascade(), *data.font, buffer, 0, 1, origin); >+ info.context().drawGlyphs(*data.font, buffer, 0, 1, origin, style.fontCascade().fontDescription().fontSmoothing()); > > return glyphPaintRect; > } >@@ -746,7 +746,7 @@ void MathOperator::paint(const RenderStyle& style, PaintInfo& info, const Layout > LayoutPoint operatorTopLeft = paintOffset; > FloatRect glyphBounds = boundsForGlyph(glyphData); > LayoutPoint operatorOrigin(operatorTopLeft.x(), operatorTopLeft.y() - glyphBounds.y()); >- paintInfo.context().drawGlyphs(style.fontCascade(), *glyphData.font, buffer, 0, 1, operatorOrigin); >+ paintInfo.context().drawGlyphs(*glyphData.font, buffer, 0, 1, operatorOrigin, style.fontCascade().fontDescription().fontSmoothing()); > } > > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >index 44621f1bf668c61c21db7399ba9ead3908fa5c39..64e3a8cc8ac507a4833d5fa6f29bbc9874d63632 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >@@ -607,7 +607,7 @@ void RenderMathMLToken::paint(PaintInfo& info, const LayoutPoint& paintOffset) > GlyphBuffer buffer; > buffer.add(mathVariantGlyph.glyph, mathVariantGlyph.font, mathVariantGlyph.font->widthForGlyph(mathVariantGlyph.glyph)); > LayoutUnit glyphAscent = static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y())); >- info.context().drawGlyphs(style().fontCascade(), *mathVariantGlyph.font, buffer, 0, 1, paintOffset + location() + LayoutPoint(0, glyphAscent)); >+ info.context().drawGlyphs(*mathVariantGlyph.font, buffer, 0, 1, paintOffset + location() + LayoutPoint(0, glyphAscent), style().fontCascade().fontDescription().fontSmoothing()); > } > > void RenderMathMLToken::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOffset, PaintInfo& paintInfoForChild, bool usePrintRect)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186886
:
343231
| 343313