Flutter Engine
android_shell_holder.h
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 
5 #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_
6 #define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_
7 
8 #include <memory>
9 
10 #include "flutter/fml/macros.h"
11 #include "flutter/fml/unique_fd.h"
12 #include "flutter/lib/ui/window/viewport_metrics.h"
13 #include "flutter/runtime/platform_data.h"
14 #include "flutter/shell/common/run_configuration.h"
15 #include "flutter/shell/common/shell.h"
16 #include "flutter/shell/common/thread_host.h"
17 #include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
18 #include "flutter/shell/platform/android/platform_view_android.h"
19 
20 namespace flutter {
21 
23  public:
25  std::shared_ptr<PlatformViewAndroidJNI> jni_facade,
26  bool is_background_view);
27 
29 
30  bool IsValid() const;
31 
32  void Launch(RunConfiguration configuration);
33 
34  const flutter::Settings& GetSettings() const;
35 
37 
39  bool base64_encode);
40 
42 
44 
45  private:
46  const flutter::Settings settings_;
47  const std::shared_ptr<PlatformViewAndroidJNI> jni_facade_;
48  fml::WeakPtr<PlatformViewAndroid> platform_view_;
49  ThreadHost thread_host_;
50  std::unique_ptr<Shell> shell_;
51  bool is_valid_ = false;
52  pthread_key_t thread_destruct_key_;
53  uint64_t next_pointer_flow_id_ = 0;
54 
55  static void ThreadDestructCallback(void* value);
56 
57  FML_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder);
58 };
59 
60 } // namespace flutter
61 
62 #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_
Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, bool base64_encode)
void Launch(RunConfiguration configuration)
AndroidShellHolder(flutter::Settings settings, std::shared_ptr< PlatformViewAndroidJNI > jni_facade, bool is_background_view)
A POD type used to return the screenshot data along with the size of the frame.
Definition: rasterizer.h:279
uint8_t value
ScreenshotType
The type of the screenshot to obtain of the previously rendered layer tree.
Definition: rasterizer.h:249
Specifies all the configuration required by the runtime library to launch the root isolate...
The collection of all the threads used by the engine.
Definition: thread_host.h:16
fml::WeakPtr< PlatformViewAndroid > GetPlatformView()
const flutter::Settings & GetSettings() const
void UpdateAssetManager(fml::RefPtr< flutter::AssetManager > asset_manager)