Title: [245753] trunk/Source/WebCore
Revision
245753
Author
[email protected]
Date
2019-05-24 14:41:32 -0700 (Fri, 24 May 2019)

Log Message

Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
https://bugs.webkit.org/show_bug.cgi?id=198225

Reviewed by Dean Jackson.

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (245752 => 245753)


--- trunk/Source/WebCore/ChangeLog	2019-05-24 21:41:00 UTC (rev 245752)
+++ trunk/Source/WebCore/ChangeLog	2019-05-24 21:41:32 UTC (rev 245753)
@@ -1,5 +1,16 @@
 2019-05-24  Timothy Hatcher  <[email protected]>
 
+        Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
+        https://bugs.webkit.org/show_bug.cgi?id=198225
+
+        Reviewed by Dean Jackson.
+
+        * platform/graphics/cocoa/FontCascadeCocoa.mm:
+        (WebCore::showLetterpressedGlyphsWithAdvances):
+        (WebCore::FontCascade::drawGlyphs):
+
+2019-05-24  Timothy Hatcher  <[email protected]>
+
         Plumb dark appearance down to GraphicsContext.
         https://bugs.webkit.org/show_bug.cgi?id=198224
         rdar://problem/51068494

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm (245752 => 245753)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2019-05-24 21:41:00 UTC (rev 245752)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2019-05-24 21:41:32 UTC (rev 245753)
@@ -98,7 +98,7 @@
 #endif
 }
 
-static void showLetterpressedGlyphsWithAdvances(const FloatPoint& point, const Font& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, unsigned count)
+static void showLetterpressedGlyphsWithAdvances(const FloatPoint& point, const Font& font, GraphicsContext& coreContext, const CGGlyph* glyphs, const CGSize* advances, unsigned count)
 {
 #if ENABLE(LETTERPRESS)
     if (!count)
@@ -110,6 +110,8 @@
         return;
     }
 
+    CGContextRef context = coreContext.platformContext();
+
     CGContextSetTextPosition(context, point.x(), point.y());
     Vector<CGPoint, 256> positions(count);
     fillVectorWithHorizontalGlyphPositions(positions, context, advances, count);
@@ -127,6 +129,10 @@
         styleConfiguration.useSimplifiedEffect = YES;
     }
 
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/FontCascadeCocoaAdditions.mm>)
+#include <WebKitAdditions/FontCascadeCocoaAdditions.mm>
+#endif
+
     CGContextSetFont(context, adoptCF(CTFontCopyGraphicsFont(ctFont, nullptr)).get());
     CGContextSetFontSize(context, platformData.size());
 
@@ -137,7 +143,7 @@
 #else
     UNUSED_PARAM(point);
     UNUSED_PARAM(font);
-    UNUSED_PARAM(context);
+    UNUSED_PARAM(coreContext);
     UNUSED_PARAM(glyphs);
     UNUSED_PARAM(advances);
     UNUSED_PARAM(count);
@@ -299,7 +305,7 @@
     }
 
     if (useLetterpressEffect)
-        showLetterpressedGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
+        showLetterpressedGlyphsWithAdvances(point, font, context, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
     else
         showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
     if (syntheticBoldOffset)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to