| 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/fonts/FontCache.h" | 7 #include "platform/fonts/FontCache.h" |
| 8 #include "platform/fonts/FontDescription.h" | 8 #include "platform/fonts/FontDescription.h" |
| 9 #include "platform/fonts/FontFallbackList.h" | 9 #include "platform/fonts/FontFallbackList.h" |
| 10 #include "platform/fonts/SegmentedFontData.h" | 10 #include "platform/fonts/SegmentedFontData.h" |
| 11 #include "platform/fonts/SimpleFontData.h" | 11 #include "platform/fonts/SimpleFontData.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 PassRefPtr<FontFallbackIterator> FontFallbackIterator::create( | 15 PassRefPtr<FontFallbackIterator> FontFallbackIterator::create( |
| 16 const FontDescription& description, | 16 const FontDescription& description, |
| 17 PassRefPtr<FontFallbackList> fallbackList, | 17 PassRefPtr<FontFallbackList> fallbackList, |
| 18 FontFallbackPriority fontFallbackPriority) | 18 FontFallbackPriority fontFallbackPriority) |
| 19 { | 19 { |
| 20 return adoptRef(new FontFallbackIterator( | 20 return adoptRef(new FontFallbackIterator( |
| 21 description, fallbackList, fontFallbackPriority)); | 21 description, std::move(fallbackList), fontFallbackPriority)); |
| 22 } | 22 } |
| 23 | 23 |
| 24 FontFallbackIterator::FontFallbackIterator(const FontDescription& description, | 24 FontFallbackIterator::FontFallbackIterator(const FontDescription& description, |
| 25 PassRefPtr<FontFallbackList> fallbackList, | 25 PassRefPtr<FontFallbackList> fallbackList, |
| 26 FontFallbackPriority fontFallbackPriority) | 26 FontFallbackPriority fontFallbackPriority) |
| 27 : m_fontDescription(description) | 27 : m_fontDescription(description) |
| 28 , m_fontFallbackList(fallbackList) | 28 , m_fontFallbackList(fallbackList) |
| 29 , m_currentFontDataIndex(0) | 29 , m_currentFontDataIndex(0) |
| 30 , m_segmentedFaceIndex(0) | 30 , m_segmentedFaceIndex(0) |
| 31 , m_fallbackStage(FontGroupFonts) | 31 , m_fallbackStage(FontGroupFonts) |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // already. | 198 // already. |
| 199 if (!hint || m_previouslyAskedForHint.contains(hint)) | 199 if (!hint || m_previouslyAskedForHint.contains(hint)) |
| 200 return nullptr; | 200 return nullptr; |
| 201 | 201 |
| 202 FontCache* fontCache = FontCache::fontCache(); | 202 FontCache* fontCache = FontCache::fontCache(); |
| 203 m_previouslyAskedForHint.add(hint); | 203 m_previouslyAskedForHint.add(hint); |
| 204 return fontCache->fallbackFontForCharacter(m_fontDescription, hint, m_fontFa
llbackList->primarySimpleFontData(m_fontDescription)); | 204 return fontCache->fallbackFontForCharacter(m_fontDescription, hint, m_fontFa
llbackList->primarySimpleFontData(m_fontDescription)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |