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 #include <zircon/assert.h>
7 
8 #include "rapidjson/document.h"
9 
10 namespace flutter_runner {
11 
13  std::string json_string) {
14  rapidjson::Document document;
15  document.Parse(json_string);
16 
17  if (!document.IsObject())
18  return;
19 
20  // Parse out all values we're expecting.
21  if (document.HasMember("vsync_offset_in_us")) {
22  auto& val = document["vsync_offset_in_us"];
23  if (val.IsInt())
24  vsync_offset_ = fml::TimeDelta::FromMicroseconds(val.GetInt());
25  }
26  if (document.HasMember("max_frames_in_flight")) {
27  auto& val = document["max_frames_in_flight"];
28  if (val.IsInt())
29  max_frames_in_flight_ = val.GetInt();
30  }
31  if (document.HasMember("intercept_all_input")) {
32  auto& val = document["intercept_all_input"];
33  if (val.IsBool())
34  intercept_all_input_ = val.GetBool();
35  }
36 #if defined(LEGACY_FUCHSIA_EMBEDDER)
37  if (document.HasMember("use_legacy_renderer")) {
38  auto& val = document["use_legacy_renderer"];
39  if (val.IsBool())
40  use_legacy_renderer_ = val.GetBool();
41  }
42 #endif
43 }
44 
45 } // namespace flutter_runner
static constexpr TimeDelta FromMicroseconds(int64_t micros)
Definition: time_delta.h:43