Title: [265490] trunk/Source/WebCore
Revision
265490
Author
[email protected]
Date
2020-08-10 23:11:42 -0700 (Mon, 10 Aug 2020)

Log Message

Fix bad merge in r265488
https://bugs.webkit.org/show_bug.cgi?id=214769

Unreviewed. This is something that got dropped in a bad merge from r265488.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::layoutSimpleText const):
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::originAt const):
(WebCore::GlyphBuffer::expandInitialAdvance):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (265489 => 265490)


--- trunk/Source/WebCore/ChangeLog	2020-08-11 05:40:52 UTC (rev 265489)
+++ trunk/Source/WebCore/ChangeLog	2020-08-11 06:11:42 UTC (rev 265490)
@@ -1,5 +1,18 @@
 2020-08-10  Myles C. Maxfield  <[email protected]>
 
+        Fix bad merge in r265488
+        https://bugs.webkit.org/show_bug.cgi?id=214769
+
+        Unreviewed. This is something that got dropped in a bad merge from r265488.
+
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::layoutSimpleText const):
+        * platform/graphics/GlyphBuffer.h:
+        (WebCore::GlyphBuffer::originAt const):
+        (WebCore::GlyphBuffer::expandInitialAdvance):
+
+2020-08-10  Myles C. Maxfield  <[email protected]>
+
         Spacing of Chinese characters is inconsistent in macOS 11/Safari 14 beta
         https://bugs.webkit.org/show_bug.cgi?id=214769
 

Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (265489 => 265490)


--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2020-08-11 05:40:52 UTC (rev 265489)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2020-08-11 06:11:42 UTC (rev 265490)
@@ -1398,6 +1398,11 @@
         initialAdvance = beforeWidth;
     }
     glyphBuffer.expandInitialAdvance(initialAdvance);
+    if (!glyphBuffer.isEmpty()) {
+        // The initial advance is supposed to point directly to the first glyph's paint position.
+        // See the ascii-art diagram in ComplexTextController.h.
+        glyphBuffer.expandInitialAdvance(GlyphBufferAdvance(glyphBuffer.originAt(0).x(), glyphBuffer.originAt(0).y()));
+    }
 
     // The glyph buffer is currently in logical order,
     // but we need to return the results in visual order.

Modified: trunk/Source/WebCore/platform/graphics/GlyphBuffer.h (265489 => 265490)


--- trunk/Source/WebCore/platform/graphics/GlyphBuffer.h	2020-08-11 05:40:52 UTC (rev 265489)
+++ trunk/Source/WebCore/platform/graphics/GlyphBuffer.h	2020-08-11 06:11:42 UTC (rev 265490)
@@ -199,11 +199,17 @@
     }
     Glyph glyphAt(unsigned index) const { return m_glyphs[index]; }
     GlyphBufferAdvance advanceAt(unsigned index) const { return m_advances[index]; }
+    GlyphBufferOrigin originAt(unsigned index) const { return m_origins[index]; }
     GlyphBufferStringOffset stringOffsetAt(unsigned index) const { return m_offsetsInString[index]; }
 
     void setInitialAdvance(GlyphBufferAdvance initialAdvance) { m_initialAdvance = initialAdvance; }
     const GlyphBufferAdvance& initialAdvance() const { return m_initialAdvance; }
     void expandInitialAdvance(float width) { m_initialAdvance.setWidth(m_initialAdvance.width() + width); }
+    void expandInitialAdvance(GlyphBufferAdvance additionalAdvance)
+    {
+        m_initialAdvance.setWidth(m_initialAdvance.width() + additionalAdvance.width());
+        m_initialAdvance.setHeight(m_initialAdvance.height() + additionalAdvance.height());
+    }
     
     static constexpr GlyphBufferStringOffset noOffset = std::numeric_limits<GlyphBufferStringOffset>::max();
     void add(Glyph glyph, const Font& font, float width, GlyphBufferStringOffset offsetInString = noOffset)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to