| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include <memory> |
| |
| #include <lib/async-loop/cpp/loop.h> |
| #include <trace-provider/provider.h> |
| |
| #include "lib/component/cpp/startup_context.h" |
| #include "lib/fsl/syslogger/init.h" |
| #include "lib/fxl/command_line.h" |
| #include "lib/fxl/log_settings_command_line.h" |
| #include "lib/fxl/logging.h" |
| |
| #include "garnet/bin/ui/scenic/app.h" |
| |
| int main(int argc, const char** argv) { |
| auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); |
| if (!fxl::SetLogSettingsFromCommandLine(command_line)) |
| return 1; |
| if (fsl::InitLoggerFromCommandLine(command_line, {"scenic"}) != ZX_OK) |
| return 1; |
| |
| async::Loop loop(&kAsyncLoopConfigAttachToThread); |
| trace::TraceProvider trace_provider(loop.dispatcher()); |
| std::unique_ptr<component::StartupContext> app_context( |
| component::StartupContext::CreateFromStartupInfo()); |
| |
| scenic::App app(app_context.get(), [&loop] { loop.Quit(); }); |
| |
| loop.Run(); |
| |
| return 0; |
| } |