Show
Ignore:
Timestamp:
12/19/07 11:24:10 (12 months ago)
Author:
hyatt@apple.com
Message:

Add support for GDI text on Windows.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/platform/graphics/FontCache.cpp

    r28626 r28867  
    4141struct FontPlatformDataCacheKey { 
    4242    FontPlatformDataCacheKey(const AtomicString& family = AtomicString(), unsigned size = 0, bool bold = false, bool italic = false, 
    43                              bool isPrinterFont = false) 
     43                             bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode) 
    4444        : m_family(family) 
    4545        , m_size(size) 
     
    4747        , m_italic(italic) 
    4848        , m_printerFont(isPrinterFont) 
     49        , m_renderingMode(renderingMode) 
    4950    { 
    5051    } 
     
    5354    { 
    5455        return equalIgnoringCase(m_family, other.m_family) && m_size == other.m_size &&  
    55                m_bold == other.m_bold && m_italic == other.m_italic && m_printerFont == other.m_printerFont; 
     56               m_bold == other.m_bold && m_italic == other.m_italic && m_printerFont == other.m_printerFont && 
     57               m_renderingMode == other.m_renderingMode; 
    5658    } 
    5759     
     
    6163    bool m_italic; 
    6264    bool m_printerFont; 
     65    FontRenderingMode m_renderingMode; 
    6366}; 
    6467 
    6568inline unsigned computeHash(const FontPlatformDataCacheKey& fontKey) 
    6669{ 
    67     unsigned hashCodes[3] = { 
     70    unsigned hashCodes[4] = { 
    6871        CaseFoldingHash::hash(fontKey.m_family), 
    6972        fontKey.m_size, 
    70         static_cast<unsigned>(fontKey.m_bold) << 2 | static_cast<unsigned>(fontKey.m_italic) << 1 | static_cast<unsigned>(fontKey.m_printerFont) 
     73        static_cast<unsigned>(fontKey.m_bold) << 3 | static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | 
     74        static_cast<unsigned>(fontKey.m_renderingMode) 
    7175    }; 
    72     return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), 3 * sizeof(unsigned) / sizeof(UChar)); 
     76    return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), 4 * sizeof(unsigned) / sizeof(UChar)); 
    7377} 
    7478 
     
    142146 
    143147    FontPlatformDataCacheKey key(familyName, fontDescription.computedPixelSize(), fontDescription.bold(), fontDescription.italic(), 
    144                                  fontDescription.usePrinterFont()); 
     148                                 fontDescription.usePrinterFont(), fontDescription.renderingMode()); 
    145149    FontPlatformData* result = 0; 
    146150    bool foundResult;