Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp

Issue 1964773002: Render Unicode control characters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: w/Test changes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 { 175 {
176 return FontCache::fontCache()->fallbackFontForCharacter( 176 return FontCache::fontCache()->fallbackFontForCharacter(
177 m_fontDescription, 177 m_fontDescription,
178 hint, 178 hint,
179 m_fontFallbackList->primarySimpleFontData(m_fontDescription), 179 m_fontFallbackList->primarySimpleFontData(m_fontDescription),
180 m_fontFallbackPriority); 180 m_fontFallbackPriority);
181 } 181 }
182 182
183 const PassRefPtr<SimpleFontData> FontFallbackIterator::uniqueSystemFontForHint(U Char32 hint) 183 const PassRefPtr<SimpleFontData> FontFallbackIterator::uniqueSystemFontForHint(U Char32 hint)
184 { 184 {
185 FontCache* fontCache = FontCache::fontCache();
186
187 // When we're asked for a fallback for the same characters again, we give up 185 // When we're asked for a fallback for the same characters again, we give up
188 // because the shaper must have previously tried shaping with the font 186 // because the shaper must have previously tried shaping with the font
189 // already. 187 // already.
190 if (m_previouslyAskedForHint.contains(hint)) 188 if (!hint || m_previouslyAskedForHint.contains(hint))
191 return nullptr; 189 return nullptr;
192 190
191 FontCache* fontCache = FontCache::fontCache();
193 m_previouslyAskedForHint.add(hint); 192 m_previouslyAskedForHint.add(hint);
194 return fontCache->fallbackFontForCharacter(m_fontDescription, hint, m_fontFa llbackList->primarySimpleFontData(m_fontDescription)); 193 return fontCache->fallbackFontForCharacter(m_fontDescription, hint, m_fontFa llbackList->primarySimpleFontData(m_fontDescription));
195 } 194 }
196 195
197 } // namespace blink 196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698