| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/fonts/FontFallbackIterator.h" | 5 #include "platform/fonts/FontFallbackIterator.h" |
| 6 | 6 |
| 7 #include "platform/Logging.h" | 7 #include "platform/Logging.h" |
| 8 #include "platform/fonts/FontCache.h" | 8 #include "platform/fonts/FontCache.h" |
| 9 #include "platform/fonts/FontDescription.h" | 9 #include "platform/fonts/FontDescription.h" |
| 10 #include "platform/fonts/FontFallbackList.h" | 10 #include "platform/fonts/FontFallbackList.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 if (*it >= fontDataRange.from() && *it <= fontDataRange.to()) { | 59 if (*it >= fontDataRange.from() && *it <= fontDataRange.to()) { |
| 60 if (!alreadyLoadingRangeForHintChar(*it)) | 60 if (!alreadyLoadingRangeForHintChar(*it)) |
| 61 return true; | 61 return true; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void FontFallbackIterator::willUseRange(const AtomicString& family, const FontDa
taRange& range) | 67 void FontFallbackIterator::willUseRange(const AtomicString& family, const FontDa
taRange& range) |
| 68 { | 68 { |
| 69 FontSelector* selector = m_fontFallbackList->fontSelector(); | 69 FontSelector* selector = m_fontFallbackList->getFontSelector(); |
| 70 if (!selector) | 70 if (!selector) |
| 71 return; | 71 return; |
| 72 | 72 |
| 73 selector->willUseRange(m_fontDescription, family, range); | 73 selector->willUseRange(m_fontDescription, family, range); |
| 74 } | 74 } |
| 75 | 75 |
| 76 const FontDataRange FontFallbackIterator::next(const Vector<UChar32>& hintList) | 76 const FontDataRange FontFallbackIterator::next(const Vector<UChar32>& hintList) |
| 77 { | 77 { |
| 78 if (m_fallbackStage == OutOfLuck) | 78 if (m_fallbackStage == OutOfLuck) |
| 79 return FontDataRange(); | 79 return FontDataRange(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 if (m_visitedSystemFonts.find(hint) != m_visitedSystemFonts.end()) { | 184 if (m_visitedSystemFonts.find(hint) != m_visitedSystemFonts.end()) { |
| 185 return nullptr; | 185 return nullptr; |
| 186 } | 186 } |
| 187 | 187 |
| 188 RefPtr<SimpleFontData> fallbackFont = fontCache->fallbackFontForCharacter(m_
fontDescription, hint, m_fontFallbackList->primarySimpleFontData(m_fontDescripti
on)); | 188 RefPtr<SimpleFontData> fallbackFont = fontCache->fallbackFontForCharacter(m_
fontDescription, hint, m_fontFallbackList->primarySimpleFontData(m_fontDescripti
on)); |
| 189 | 189 |
| 190 return m_visitedSystemFonts.add(hint, fallbackFont).storedValue->value; | 190 return m_visitedSystemFonts.add(hint, fallbackFont).storedValue->value; |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |