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

Side by Side Diff: blimp/client/app/linux/blimp_main.cc

Issue 2618443002: Remove use of legacy SkFontMgr factories. (Closed)
Patch Set: Forward declare when possible. Created 3 years, 11 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 | content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <string> 5 #include <string>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 std::string GetAndroidFontsDirectory() { 56 std::string GetAndroidFontsDirectory() {
57 std::string android_fonts_dir = 57 std::string android_fonts_dir =
58 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 58 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
59 kAndroidFontsPath); 59 kAndroidFontsPath);
60 if (android_fonts_dir.size() > 0 && android_fonts_dir.back() != '/') { 60 if (android_fonts_dir.size() > 0 && android_fonts_dir.back() != '/') {
61 android_fonts_dir += '/'; 61 android_fonts_dir += '/';
62 } 62 }
63 return android_fonts_dir; 63 return android_fonts_dir;
64 } 64 }
65 65
66 SkFontMgr* CreateAndroidFontMgr(std::string android_fonts_dir) { 66 sk_sp<SkFontMgr> CreateAndroidFontMgr(std::string android_fonts_dir) {
67 SkFontMgr_Android_CustomFonts custom; 67 SkFontMgr_Android_CustomFonts custom;
68 custom.fSystemFontUse = 68 custom.fSystemFontUse =
69 SkFontMgr_Android_CustomFonts::SystemFontUse::kOnlyCustom; 69 SkFontMgr_Android_CustomFonts::SystemFontUse::kOnlyCustom;
70 custom.fBasePath = android_fonts_dir.c_str(); 70 custom.fBasePath = android_fonts_dir.c_str();
71 71
72 std::string font_config; 72 std::string font_config;
73 std::string fallback_font_config; 73 std::string fallback_font_config;
74 if (android_fonts_dir.find("kitkat") != std::string::npos) { 74 if (android_fonts_dir.find("kitkat") != std::string::npos) {
75 font_config = android_fonts_dir + "system_fonts.xml"; 75 font_config = android_fonts_dir + "system_fonts.xml";
76 fallback_font_config = android_fonts_dir + "fallback_fonts.xml"; 76 fallback_font_config = android_fonts_dir + "fallback_fonts.xml";
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 std::unique_ptr<blimp::client::BlimpDisplayManagerDelegate> 164 std::unique_ptr<blimp::client::BlimpDisplayManagerDelegate>
165 display_manager_delegate = 165 display_manager_delegate =
166 base::MakeUnique<blimp::client::BlimpDisplayManagerDelegateMain>(); 166 base::MakeUnique<blimp::client::BlimpDisplayManagerDelegateMain>();
167 blimp::client::BlimpDisplayManager display_manager( 167 blimp::client::BlimpDisplayManager display_manager(
168 display_manager_delegate.get(), compositor_dependencies); 168 display_manager_delegate.get(), compositor_dependencies);
169 display_manager.SetWindowSize(gfx::Size(kWindowWidth, kWindowHeight)); 169 display_manager.SetWindowSize(gfx::Size(kWindowWidth, kWindowHeight));
170 display_manager.SetBlimpContents(std::move(contents)); 170 display_manager.SetBlimpContents(std::move(contents));
171 171
172 base::RunLoop().Run(); 172 base::RunLoop().Run();
173 } 173 }
OLDNEW
« no previous file with comments | « no previous file | content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698