Title: [269823] trunk/Source/WebCore
Revision
269823
Author
[email protected]
Date
2020-11-15 00:56:23 -0800 (Sun, 15 Nov 2020)

Log Message

Font::platformBoundsForGlyph() should provide a boundingRect pointer to CTFontGetBoundingRectsForGlyphs()
https://bugs.webkit.org/show_bug.cgi?id=218812

Patch by Julian Gonzalez <[email protected]> on 2020-11-15
Reviewed by Ryosuke Niwa.

Provide a zero CGRect boundingRect pointer in two places where the count argument
to CTFontGetBoundingRectsForGlyphs() is already 1.

No new tests, no behavior changes.

* platform/graphics/coretext/FontCoreText.cpp:
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::isProbablyOnlyUsedToRenderIcons const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (269822 => 269823)


--- trunk/Source/WebCore/ChangeLog	2020-11-15 01:38:12 UTC (rev 269822)
+++ trunk/Source/WebCore/ChangeLog	2020-11-15 08:56:23 UTC (rev 269823)
@@ -1,3 +1,19 @@
+2020-11-15  Julian Gonzalez  <[email protected]>
+
+        Font::platformBoundsForGlyph() should provide a boundingRect pointer to CTFontGetBoundingRectsForGlyphs()
+        https://bugs.webkit.org/show_bug.cgi?id=218812
+
+        Reviewed by Ryosuke Niwa.
+
+        Provide a zero CGRect boundingRect pointer in two places where the count argument
+        to CTFontGetBoundingRectsForGlyphs() is already 1.
+
+        No new tests, no behavior changes.
+
+        * platform/graphics/coretext/FontCoreText.cpp:
+        (WebCore::Font::platformBoundsForGlyph const):
+        (WebCore::Font::isProbablyOnlyUsedToRenderIcons const):
+
 2020-11-14  Simon Fraser  <[email protected]>
 
         [LFC Display] Implement propagation background style from body to root

Modified: trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp (269822 => 269823)


--- trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp	2020-11-15 01:38:12 UTC (rev 269822)
+++ trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp	2020-11-15 08:56:23 UTC (rev 269823)
@@ -699,7 +699,8 @@
 FloatRect Font::platformBoundsForGlyph(Glyph glyph) const
 {
     FloatRect boundingBox;
-    boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(), platformData().orientation() == FontOrientation::Vertical ? kCTFontOrientationVertical : kCTFontOrientationHorizontal, &glyph, 0, 1);
+    CGRect emptyRect;
+    boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(), platformData().orientation() == FontOrientation::Vertical ? kCTFontOrientationVertical : kCTFontOrientationHorizontal, &glyph, &emptyRect, 1);
     boundingBox.setY(-boundingBox.maxY());
     if (m_syntheticBoldOffset)
         boundingBox.setWidth(boundingBox.width() + m_syntheticBoldOffset);
@@ -743,7 +744,8 @@
     UniChar lowercaseACharacter = 'a';
     CGGlyph lowercaseAGlyph;
     if (CTFontGetGlyphsForCharacters(platformFont, &lowercaseACharacter, &lowercaseAGlyph, 1)) {
-        if (!CGRectIsEmpty(CTFontGetBoundingRectsForGlyphs(platformFont, kCTFontOrientationDefault, &lowercaseAGlyph, nullptr, 1)))
+        CGRect emptyRect;
+        if (!CGRectIsEmpty(CTFontGetBoundingRectsForGlyphs(platformFont, kCTFontOrientationDefault, &lowercaseAGlyph, &emptyRect, 1)))
             return false;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to