Title: [181703] trunk/Source/WebCore
Revision
181703
Author
mmaxfi...@apple.com
Date
2015-03-18 11:12:39 -0700 (Wed, 18 Mar 2015)

Log Message

Call CTFontSetRenderingParameters before rendering text
https://bugs.webkit.org/show_bug.cgi?id=142816

Reviewed by Darin Adler.

No new tests.

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showGlyphsWithAdvances):
* platform/spi/cocoa/CoreTextSPI.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (181702 => 181703)


--- trunk/Source/WebCore/ChangeLog	2015-03-18 17:50:52 UTC (rev 181702)
+++ trunk/Source/WebCore/ChangeLog	2015-03-18 18:12:39 UTC (rev 181703)
@@ -1,3 +1,16 @@
+2015-03-18  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Call CTFontSetRenderingParameters before rendering text
+        https://bugs.webkit.org/show_bug.cgi?id=142816
+
+        Reviewed by Darin Adler.
+
+        No new tests.
+
+        * platform/graphics/cocoa/FontCascadeCocoa.mm:
+        (WebCore::showGlyphsWithAdvances):
+        * platform/spi/cocoa/CoreTextSPI.h:
+
 2015-03-18  Chris Dumez  <cdu...@apple.com>
 
         [WK2] Log the number of network cache requests that we have never seen before

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


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2015-03-18 17:50:52 UTC (rev 181702)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2015-03-18 18:12:39 UTC (rev 181703)
@@ -161,18 +161,24 @@
             position.x += advances[i].width;
             position.y += advances[i].height;
         }
-        if (!platformData.isColorBitmapFont())
+        if (!platformData.isColorBitmapFont()) {
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101000
+            CTFontSetRenderingParameters(platformData.ctFont(), context);
+#endif
             CGContextShowGlyphsAtPositions(context, glyphs, positions.data(), count);
-        else
+        } else
             CTFontDrawGlyphs(platformData.ctFont(), glyphs, positions.data(), count, context);
         CGContextSetTextMatrix(context, savedMatrix);
     } else {
-        if (!platformData.isColorBitmapFont())
+        if (!platformData.isColorBitmapFont()) {
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101000
+            CTFontSetRenderingParameters(platformData.ctFont(), context);
+#endif
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
             CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
 #pragma clang diagnostic pop
-        else
+        } else
             CTFontDrawGlyphs(platformData.ctFont(), glyphs, positions.data(), count, context);
     }
 }

Modified: trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h (181702 => 181703)


--- trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h	2015-03-18 17:50:52 UTC (rev 181702)
+++ trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h	2015-03-18 18:12:39 UTC (rev 181703)
@@ -65,6 +65,9 @@
 CTLineRef CTLineCreateWithUniCharProvider(CTUniCharProviderCallback provide, CTUniCharDisposeCallback dispose, void* refCon);
 CTTypesetterRef CTTypesetterCreateWithUniCharProviderAndOptions(CTUniCharProviderCallback provide, CTUniCharDisposeCallback dispose, void* refCon, CFDictionaryRef options);
 bool CTFontGetVerticalGlyphsForCharacters(CTFontRef, const UniChar characters[], CGGlyph glyphs[], CFIndex count);
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101000
+void CTFontSetRenderingParameters(CTFontRef, CGContextRef);
+#endif
 
 CTFontDescriptorRef CTFontDescriptorCreateForUIType(CTFontUIFontType, CGFloat size, CFStringRef language);
 CTFontDescriptorRef CTFontDescriptorCreateWithTextStyle(CFStringRef style, CFStringRef size, CFStringRef language);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to