Flutter Engine
 
Loading...
Searching...
No Matches
android_surface_dynamic_impeller.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_SURFACE_DYNAMIC_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_DYNAMIC_IMPELLER_H_
7
19
20namespace flutter {
21
22/// @brief An Impeller Android surface class that dynamically creates either an
23/// [AndroidSurfaceVKImpeller] or an [AndroidSurfaceGLImpeller].
24///
25/// The backing surface is created the first time [CreateGPUSurface] is called.
27 public:
29 std::shared_ptr<AndroidContextDynamicImpeller>& android_context);
30
32
33 // |AndroidSurface|
34 bool IsValid() const override;
35
36 // |AndroidSurface|
37 std::unique_ptr<Surface> CreateGPUSurface(
38 GrDirectContext* gr_context) override;
39
40 // |AndroidSurface|
41 void TeardownOnScreenContext() override;
42
43 // |AndroidSurface|
44 bool OnScreenSurfaceResize(const DlISize& size) override;
45
46 // |AndroidSurface|
47 bool ResourceContextMakeCurrent() override;
48
49 // |AndroidSurface|
50 bool ResourceContextClearCurrent() override;
51
52 // |AndroidSurface|
53 std::shared_ptr<impeller::Context> GetImpellerContext() override;
54
55 // |AndroidSurface|
56 bool SetNativeWindow(
58 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade) override;
59
60 // |AndroidSurface|
61 std::unique_ptr<Surface> CreateSnapshotSurface() override;
62
63 // |AndroidSurface|
64 void SetupImpellerSurface() override;
65
66 private:
67 std::shared_ptr<AndroidContextDynamicImpeller> android_context_;
68 std::unique_ptr<AndroidSurfaceVKImpeller> vulkan_surface_;
69 std::unique_ptr<AndroidSurfaceGLImpeller> gl_surface_;
71 std::shared_ptr<PlatformViewAndroidJNI> jni_facade_;
72 bool is_valid_ = false;
73
75};
76
77} // namespace flutter
78
79#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_DYNAMIC_IMPELLER_H_
An Impeller Android surface class that dynamically creates either an [AndroidSurfaceVKImpeller] or an...
bool OnScreenSurfaceResize(const DlISize &size) override
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context) override
bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade) override
std::shared_ptr< impeller::Context > GetImpellerContext() override
std::unique_ptr< Surface > CreateSnapshotSurface() override
GLFWwindow * window
Definition main.cc:60
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size