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" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (fallback_stage_ == kOutOfLuck) | 87 if (fallback_stage_ == kOutOfLuck) |
88 return AdoptRef(new FontDataForRangeSet()); | 88 return AdoptRef(new FontDataForRangeSet()); |
89 | 89 |
90 if (fallback_stage_ == kFallbackPriorityFonts) { | 90 if (fallback_stage_ == kFallbackPriorityFonts) { |
91 // Only try one fallback priority font, | 91 // Only try one fallback priority font, |
92 // then proceed to regular system fallback. | 92 // then proceed to regular system fallback. |
93 fallback_stage_ = kSystemFonts; | 93 fallback_stage_ = kSystemFonts; |
94 RefPtr<FontDataForRangeSet> fallback_priority_font_range = | 94 RefPtr<FontDataForRangeSet> fallback_priority_font_range = |
95 AdoptRef(new FontDataForRangeSet(FallbackPriorityFont(hint_list[0]))); | 95 AdoptRef(new FontDataForRangeSet(FallbackPriorityFont(hint_list[0]))); |
96 if (fallback_priority_font_range->HasFontData()) | 96 if (fallback_priority_font_range->HasFontData()) |
97 return UniqueOrNext(fallback_priority_font_range.Release(), hint_list); | 97 return UniqueOrNext(std::move(fallback_priority_font_range), hint_list); |
98 return Next(hint_list); | 98 return Next(hint_list); |
99 } | 99 } |
100 | 100 |
101 if (fallback_stage_ == kSystemFonts) { | 101 if (fallback_stage_ == kSystemFonts) { |
102 // We've reached pref + system fallback. | 102 // We've reached pref + system fallback. |
103 RefPtr<SimpleFontData> system_font = UniqueSystemFontForHintList(hint_list); | 103 RefPtr<SimpleFontData> system_font = UniqueSystemFontForHintList(hint_list); |
104 if (system_font) { | 104 if (system_font) { |
105 // Fallback fonts are not retained in the FontDataCache. | 105 // Fallback fonts are not retained in the FontDataCache. |
106 return UniqueOrNext(AdoptRef(new FontDataForRangeSet(system_font)), | 106 return UniqueOrNext(AdoptRef(new FontDataForRangeSet(system_font)), |
107 hint_list); | 107 hint_list); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 if (!hint || previously_asked_for_hint_.Contains(hint)) | 237 if (!hint || previously_asked_for_hint_.Contains(hint)) |
238 return nullptr; | 238 return nullptr; |
239 previously_asked_for_hint_.insert(hint); | 239 previously_asked_for_hint_.insert(hint); |
240 return font_cache->FallbackFontForCharacter( | 240 return font_cache->FallbackFontForCharacter( |
241 font_description_, hint, | 241 font_description_, hint, |
242 font_fallback_list_->PrimarySimpleFontData(font_description_)); | 242 font_fallback_list_->PrimarySimpleFontData(font_description_)); |
243 } | 243 } |
244 | 244 |
245 } // namespace blink | 245 } // namespace blink |
OLD | NEW |