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

Side by Side Diff: chrome/browser/android/vr_shell/textures/ui_texture.cc

Issue 2926303003: [vr] Fix incorrect negation in font fallback logic. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "chrome/browser/android/vr_shell/textures/ui_texture.h" 5 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 gfx::Font default_font(kDefaultFontFamily, size); 186 gfx::Font default_font(kDefaultFontFamily, size);
187 std::vector<gfx::Font> fonts{default_font}; 187 std::vector<gfx::Font> fonts{default_font};
188 188
189 std::set<std::string> names; 189 std::set<std::string> names;
190 // TODO(acondor): Query BrowserProcess to obtain the application locale. 190 // TODO(acondor): Query BrowserProcess to obtain the application locale.
191 for (UChar32 c : CollectDifferentChars(text)) { 191 for (UChar32 c : CollectDifferentChars(text)) {
192 std::string name; 192 std::string name;
193 bool found_name = GetFallbackFontNameForChar(default_font, c, "", &name); 193 bool found_name = GetFallbackFontNameForChar(default_font, c, "", &name);
194 if (!found_name) 194 if (!found_name)
195 return false; 195 return false;
196 if (name.empty()) 196 if (!name.empty())
197 names.insert(name); 197 names.insert(name);
198 } 198 }
199 for (const auto& name : names) 199 for (const auto& name : names) {
200 DCHECK(!name.empty());
200 fonts.push_back(gfx::Font(name, size)); 201 fonts.push_back(gfx::Font(name, size));
202 }
201 *font_list = gfx::FontList(fonts); 203 *font_list = gfx::FontList(fonts);
202 return true; 204 return true;
203 } 205 }
204 206
205 void UiTexture::SetForceFontFallbackFailureForTesting(bool force) { 207 void UiTexture::SetForceFontFallbackFailureForTesting(bool force) {
206 force_font_fallback_failure_for_testing_ = force; 208 force_font_fallback_failure_for_testing_ = force;
207 } 209 }
208 210
209 } // namespace vr_shell 211 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/textures/url_bar_texture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698