Changeset 28867 for trunk/WebCore/platform/graphics/FontCache.cpp
- Timestamp:
- 12/19/07 11:24:10 (12 months ago)
- Files:
-
- 1 modified
-
trunk/WebCore/platform/graphics/FontCache.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/platform/graphics/FontCache.cpp
r28626 r28867 41 41 struct FontPlatformDataCacheKey { 42 42 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) 44 44 : m_family(family) 45 45 , m_size(size) … … 47 47 , m_italic(italic) 48 48 , m_printerFont(isPrinterFont) 49 , m_renderingMode(renderingMode) 49 50 { 50 51 } … … 53 54 { 54 55 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; 56 58 } 57 59 … … 61 63 bool m_italic; 62 64 bool m_printerFont; 65 FontRenderingMode m_renderingMode; 63 66 }; 64 67 65 68 inline unsigned computeHash(const FontPlatformDataCacheKey& fontKey) 66 69 { 67 unsigned hashCodes[ 3] = {70 unsigned hashCodes[4] = { 68 71 CaseFoldingHash::hash(fontKey.m_family), 69 72 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) 71 75 }; 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)); 73 77 } 74 78 … … 142 146 143 147 FontPlatformDataCacheKey key(familyName, fontDescription.computedPixelSize(), fontDescription.bold(), fontDescription.italic(), 144 fontDescription.usePrinterFont() );148 fontDescription.usePrinterFont(), fontDescription.renderingMode()); 145 149 FontPlatformData* result = 0; 146 150 bool foundResult;