Title: [245755] branches/safari-608.1.24.20-branch/Source/WebCore
Revision
245755
Author
[email protected]
Date
2019-05-24 14:47:36 -0700 (Fri, 24 May 2019)

Log Message

Cherry-pick r245753. rdar://problem/51068494

    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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog (245754 => 245755)


--- branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog	2019-05-24 21:47:32 UTC (rev 245754)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog	2019-05-24 21:47:36 UTC (rev 245755)
@@ -1,5 +1,32 @@
 2019-05-24  Alan Coon  <[email protected]>
 
+        Cherry-pick r245753. rdar://problem/51068494
+
+    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):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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  Alan Coon  <[email protected]>
+
         Cherry-pick r245752. rdar://problem/51068494
 
     Plumb dark appearance down to GraphicsContext.

Modified: branches/safari-608.1.24.20-branch/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm (245754 => 245755)


--- branches/safari-608.1.24.20-branch/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2019-05-24 21:47:32 UTC (rev 245754)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2019-05-24 21:47:36 UTC (rev 245755)
@@ -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