blob: 25fb94e54ad4f8aed5c665ee01f51bb9bc7bf0e4 [file] [log] [blame]
// 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/app/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(&kAsyncLoopConfigMakeDefault);
trace::TraceProvider trace_provider(loop.async());
std::unique_ptr<fuchsia::sys::StartupContext> app_context(
fuchsia::sys::StartupContext::CreateFromStartupInfo());
scenic::App app(app_context.get(), [&loop] { loop.Quit(); });
loop.Run();
return 0;
}