| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2007 Apple Computer, Inc. |
| 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // static | 93 // static |
| 94 void FontCache::setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht) | 94 void FontCache::setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht) |
| 95 { | 95 { |
| 96 s_statusFontFamilyName = new AtomicString(familyName); | 96 s_statusFontFamilyName = new AtomicString(familyName); |
| 97 s_statusFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); | 97 s_statusFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); |
| 98 } | 98 } |
| 99 | 99 |
| 100 FontCache::FontCache() | 100 FontCache::FontCache() |
| 101 : m_purgePreventCount(0) | 101 : m_purgePreventCount(0) |
| 102 { | 102 { |
| 103 m_fontManager = s_fontManager; | 103 m_fontManager = s_staticFontManager; |
| 104 if (!m_fontManager.get()) | 104 if (!m_fontManager.get()) |
| 105 m_fontManager = adoptRef(SkFontMgr_New_DirectWrite()); | 105 m_fontManager = adoptRef(SkFontMgr_New_DirectWrite()); |
| 106 ASSERT(m_fontManager.get()); | 106 ASSERT(m_fontManager.get()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Given the desired base font, this will create a SimpleFontData for a specific | 109 // Given the desired base font, this will create a SimpleFontData for a specific |
| 110 // font that can be used to render the given range of characters. | 110 // font that can be used to render the given range of characters. |
| 111 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter( | 111 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter( |
| 112 const FontDescription& fontDescription, UChar32 character, | 112 const FontDescription& fontDescription, UChar32 character, |
| 113 const SimpleFontData* originalFontData, | 113 const SimpleFontData* originalFontData, |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 if (typefacesMatchesFamily(tf.get(), family)) { | 444 if (typefacesMatchesFamily(tf.get(), family)) { |
| 445 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); | 445 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
| 446 break; | 446 break; |
| 447 } | 447 } |
| 448 } | 448 } |
| 449 | 449 |
| 450 return result; | 450 return result; |
| 451 } | 451 } |
| 452 | 452 |
| 453 } // namespace blink | 453 } // namespace blink |
| OLD | NEW |