Commit 952c4e34 authored by Ben Wagner's avatar Ben Wagner Committed by Commit Bot

Update SkFCI::SetGlobal to smart pointers.

This updates SkFontConfigInterface::SetGlobal calls to use the smart
pointer version. This removes the awkward trailing ->unref and will
allow Skia to remove the old non-smart version of this method.

Change-Id: Icf67a1976820f5f0f07243ab1539e90e18db2ef4
Reviewed-on: https://chromium-review.googlesource.com/1058019Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Ben Wagner <bungeman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558712}
parent c41a36a3
...@@ -396,7 +396,7 @@ void PreSandboxInit() { ...@@ -396,7 +396,7 @@ void PreSandboxInit() {
InitializeWebRtcModule(); InitializeWebRtcModule();
#endif #endif
SkFontConfigInterface::SetGlobal(new FontConfigIPC(GetSandboxFD()))->unref(); SkFontConfigInterface::SetGlobal(sk_make_sp<FontConfigIPC>(GetSandboxFD()));
// Set the android SkFontMgr for blink. We need to ensure this is done // Set the android SkFontMgr for blink. We need to ensure this is done
// before the sandbox is initialized to allow the font manager to access // before the sandbox is initialized to allow the font manager to access
......
...@@ -343,8 +343,7 @@ int GpuMain(const MainFunctionParams& parameters) { ...@@ -343,8 +343,7 @@ int GpuMain(const MainFunctionParams& parameters) {
SkGraphics::Init(); SkGraphics::Init();
#if defined(OS_LINUX) #if defined(OS_LINUX)
// Set up the font IPC so that the GPU process can create typefaces. // Set up the font IPC so that the GPU process can create typefaces.
SkFontConfigInterface::SetGlobal(new FontConfigIPC(GetSandboxFD())) SkFontConfigInterface::SetGlobal(sk_make_sp<FontConfigIPC>(GetSandboxFD()));
->unref();
#endif #endif
} }
......
...@@ -132,8 +132,7 @@ int RendererMain(const MainFunctionParams& parameters) { ...@@ -132,8 +132,7 @@ int RendererMain(const MainFunctionParams& parameters) {
// This call could already have been made from zygote_main_linux.cc. However // This call could already have been made from zygote_main_linux.cc. However
// we need to do it here if Zygote is disabled. // we need to do it here if Zygote is disabled.
if (process_command_line.HasSwitch(switches::kNoZygote)) { if (process_command_line.HasSwitch(switches::kNoZygote)) {
SkFontConfigInterface::SetGlobal(new FontConfigIPC(GetSandboxFD())) SkFontConfigInterface::SetGlobal(sk_make_sp<FontConfigIPC>(GetSandboxFD()));
->unref();
} }
#endif #endif
......
...@@ -114,7 +114,7 @@ bool AuraInit::Init(service_manager::Connector* connector, ...@@ -114,7 +114,7 @@ bool AuraInit::Init(service_manager::Connector* connector,
// Initialize the skia font code to go ask fontconfig underneath. // Initialize the skia font code to go ask fontconfig underneath.
#if defined(OS_LINUX) #if defined(OS_LINUX)
font_loader_ = sk_make_sp<font_service::FontLoader>(connector); font_loader_ = sk_make_sp<font_service::FontLoader>(connector);
SkFontConfigInterface::SetGlobal(font_loader_.get()); SkFontConfigInterface::SetGlobal(font_loader_);
// Initialize static default font, by running this now, before any other apps // Initialize static default font, by running this now, before any other apps
// load, we ensure all the state is set up. // load, we ensure all the state is set up.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment