Changeset 91237 in webkit


Ignore:
Timestamp:
Jul 18, 2011 9:14:42 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

REGRESSION(91209?): fast/css/custom-font-xheight.html is failing on Leopard
https://bugs.webkit.org/show_bug.cgi?id=64767

Add a runtime check for font cascading optimization.

It's a constant value in Mac port so hopefully gcc will constant-propagate the value
and eliminate the function altogether.

  • platform/graphics/cocoa/FontPlatformDataCocoa.mm:

(WebCore::canSetCascadeListForCustomFont): Added.
(WebCore::FontPlatformData::ctFont):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r91235 r91237  
     12011-07-18  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION(91209?): fast/css/custom-font-xheight.html is failing on Leopard
     4        https://bugs.webkit.org/show_bug.cgi?id=64767
     5
     6        Add a runtime check for font cascading optimization.
     7
     8        It's a constant value in Mac port so hopefully gcc will constant-propagate the value
     9        and eliminate the function altogether.
     10
     11        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
     12        (WebCore::canSetCascadeListForCustomFont): Added.
     13        (WebCore::FontPlatformData::ctFont):
     14
    1152011-07-18  MORITA Hajime  <morrita@google.com>
    216
  • trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

    r91231 r91237  
    193193}
    194194
     195// Adding a cascade list breaks the font on Leopard
     196static bool canSetCascadeListForCustomFont()
     197{
     198#if PLATFORM(CHROMIUM)
     199    static SInt32 systemVersion;
     200    if (!systemVersion) {
     201        if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr)
     202            return false;
     203    }
     204
     205    return systemVersion >= 0x1060;
     206#elif !defined(BUILDING_ON_LEOPARD)
     207    return true;
     208#else
     209    return false;
     210#endif
     211}
     212
    195213CTFontRef FontPlatformData::ctFont() const
    196214{
     
    201219    if (m_CTFont)
    202220        m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
    203     else {
    204 #if !defined(BUILDING_ON_LEOPARD)
    205         m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
    206 #else
    207         m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0));
    208 #endif
    209     }
     221    else
     222        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, canSetCascadeListForCustomFont() ? cascadeToLastResortFontDescriptor() : 0));
    210223
    211224    if (m_widthVariant != RegularWidth) {
Note: See TracChangeset for help on using the changeset viewer.