5#include "flutter/shell/platform/common/engine_switches.h"
15 std::vector<std::string> switches;
18#ifndef FLUTTER_RELEASE
19 const char* switch_count_key =
"FLUTTER_ENGINE_SWITCHES";
20 const int kMaxSwitchCount = 50;
21 const char* switch_count_string =
std::getenv(switch_count_key);
22 if (!switch_count_string) {
25 int switch_count =
std::min(kMaxSwitchCount, atoi(switch_count_string));
26 for (
int i = 1;
i <= switch_count; ++
i) {
27 std::ostringstream switch_key;
28 switch_key <<
"FLUTTER_ENGINE_SWITCH_" <<
i;
29 const char* switch_value =
std::getenv(switch_key.str().c_str());
31 std::ostringstream switch_value_as_flag;
32 switch_value_as_flag <<
"--" << switch_value;
33 switches.push_back(switch_value_as_flag.str());
35 std::cerr << switch_count <<
" keys expected from " << switch_count_key
36 <<
", but " << switch_key.str() <<
" is missing." << std::endl;
static float min(float r, float g, float b)
std::vector< std::string > GetSwitchesFromEnvironment()