Flutter Impeller
switches.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include <cstdlib>
8 
9 #include "flutter/fml/build_config.h"
10 
11 namespace impeller {
12 
14 
15 PlaygroundSwitches::PlaygroundSwitches(const fml::CommandLine& args) {
16  enable_playground = args.HasOption("enable_playground");
17  std::string timeout_str;
18  if (args.GetOptionValue("playground_timeout_ms", &timeout_str)) {
19  timeout = std::chrono::milliseconds(atoi(timeout_str.c_str()));
20  // Specifying a playground timeout implies you want to enable playgrounds.
21  enable_playground = true;
22  }
23  enable_vulkan_validation = args.HasOption("enable_vulkan_validation");
24  use_swiftshader = args.HasOption("use_swiftshader");
25  use_angle = args.HasOption("use_angle");
26 #if FML_OS_MACOSX
27  // OpenGL on macOS is busted and deprecated. Use Angle there by default.
28  use_angle = true;
29 #endif // FML_OS_MACOSX
30 }
31 
32 } // namespace impeller
std::optional< std::chrono::milliseconds > timeout
Definition: switches.h:21