Flutter Engine
The Flutter Engine
flutter_runner_product_configuration.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 <zircon/assert.h>
8
9#include "flutter/fml/logging.h"
10#include "rapidjson/document.h"
11
12namespace flutter_runner {
13
15 std::string json_string) {
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 // Parse out all values we're expecting.
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}
51
52} // namespace flutter_runner
#define FML_LOG(severity)
Definition: logging.h:82
#define ERROR(message)
Definition: elf_loader.cc:260