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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // static | 97 // static |
98 void FontCache::setStatusFontMetrics(const wchar_t* familyName, | 98 void FontCache::setStatusFontMetrics(const wchar_t* familyName, |
99 int32_t fontHeight) { | 99 int32_t fontHeight) { |
100 s_statusFontFamilyName = new AtomicString(familyName); | 100 s_statusFontFamilyName = new AtomicString(familyName); |
101 s_statusFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); | 101 s_statusFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); |
102 } | 102 } |
103 | 103 |
104 FontCache::FontCache() : m_purgePreventCount(0) { | 104 FontCache::FontCache() : m_purgePreventCount(0) { |
105 m_fontManager = sk_ref_sp(s_staticFontManager); | 105 m_fontManager = sk_ref_sp(s_staticFontManager); |
106 if (!m_fontManager) | 106 if (!m_fontManager) |
107 m_fontManager.reset(SkFontMgr_New_DirectWrite()); | 107 m_fontManager = SkFontMgr_New_DirectWrite(); |
108 ASSERT(m_fontManager.get()); | 108 ASSERT(m_fontManager.get()); |
109 } | 109 } |
110 | 110 |
111 // Given the desired base font, this will create a SimpleFontData for a specific | 111 // Given the desired base font, this will create a SimpleFontData for a specific |
112 // font that can be used to render the given range of characters. | 112 // font that can be used to render the given range of characters. |
113 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter( | 113 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter( |
114 const FontDescription& fontDescription, | 114 const FontDescription& fontDescription, |
115 UChar32 character, | 115 UChar32 character, |
116 const SimpleFontData* originalFontData, | 116 const SimpleFontData* originalFontData, |
117 FontFallbackPriority fallbackPriority) { | 117 FontFallbackPriority fallbackPriority) { |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 if (typefacesMatchesFamily(tf.get(), family)) { | 414 if (typefacesMatchesFamily(tf.get(), family)) { |
415 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); | 415 result->setMinSizeForSubpixel(minSizeForSubpixelForFont); |
416 break; | 416 break; |
417 } | 417 } |
418 } | 418 } |
419 | 419 |
420 return result; | 420 return result; |
421 } | 421 } |
422 | 422 |
423 } // namespace blink | 423 } // namespace blink |
OLD | NEW |