15 {
16 rapidjson::Document document;
17 document.Parse(json_string);
18
19 if (!document.IsObject()) {
20 FML_LOG(
ERROR) <<
"Failed to parse configuration; using defaults: "
21 << json_string;
22 return;
23 }
24
25
26 if (document.HasMember("intercept_all_input")) {
27 auto& val = document["intercept_all_input"];
28 if (val.IsBool()) {
29 intercept_all_input_ = val.GetBool();
30 }
31 }
32 if (document.HasMember("software_rendering")) {
33 auto& val = document["software_rendering"];
34 if (val.IsBool()) {
35 software_rendering_ = val.GetBool();
36 }
37 }
38 if (document.HasMember("enable_shader_warmup")) {
39 auto& val = document["enable_shader_warmup"];
40 if (val.IsBool()) {
41 enable_shader_warmup_ = val.GetBool();
42 }
43 }
44 if (document.HasMember("enable_shader_warmup_dart_hooks")) {
45 auto& val = document["enable_shader_warmup_dart_hooks"];
46 if (val.IsBool()) {
47 enable_shader_warmup_dart_hooks_ = val.GetBool();
48 }
49 }
50}
#define FML_LOG(severity)