5#ifndef FLUTTER_SHELL_COMMON_SWITCH_DEFS_H_
6#define FLUTTER_SHELL_COMMON_SWITCH_DEFS_H_
11#ifndef DEF_SWITCHES_START
12#define DEF_SWITCHES_START enum class Switch {
15#define DEF_SWITCH(swtch, flag, help) swtch,
17#ifndef DEF_SWITCHES_END
18#define DEF_SWITCHES_END Sentinel, } ;
24 "aot-shared-library-name",
25 "Name of the *.so containing AOT compiled Dart assets.")
26DEF_SWITCH(AotVMServiceSharedLibraryName,
27 "aot-vmservice-shared-library-
name",
28 "Name of the *.so containing AOT compiled Dart assets for "
29 "launching the service isolate.")
30DEF_SWITCH(SnapshotAssetPath,
31 "snapshot-asset-
path",
32 "
Path to the directory containing the four files specified by "
33 "VmSnapshotData, VmSnapshotInstructions, "
34 "VmSnapshotInstructions and IsolateSnapshotInstructions.")
35DEF_SWITCH(VmSnapshotData,
37 "The VM snapshot
data that will be memory mapped as read-only. "
38 "SnapshotAssetPath must be present.")
39DEF_SWITCH(VmSnapshotInstructions,
41 "The VM instructions snapshot that will be memory mapped as read "
42 "and executable. SnapshotAssetPath must be present.")
43DEF_SWITCH(IsolateSnapshotData,
44 "isolate-snapshot-
data",
45 "The isolate snapshot
data that will be memory mapped as read-only. "
46 "SnapshotAssetPath must be present.")
47DEF_SWITCH(IsolateSnapshotInstructions,
48 "isolate-snapshot-instr",
49 "The isolate instructions snapshot that will be memory mapped as "
50 "read and executable. SnapshotAssetPath must be present.")
51DEF_SWITCH(CacheDirPath,
53 "
Path to the cache directory. "
54 "This is different from the persistent_cache_path in embedder.
h, "
55 "which is used for Skia shader cache.")
56DEF_SWITCH(ICUDataFilePath, "icu-
data-file-
path", "
Path to the ICU
data file.")
57DEF_SWITCH(ICUSymbolPrefix,
59 "Prefix for the symbols representing ICU
data linked into the "
61DEF_SWITCH(ICUNativeLibPath,
62 "icu-native-lib-
path",
63 "
Path to the library file that exports the ICU
data.")
66 "
Flags passed directly to the Dart VM without being interpreted "
67 "by the Flutter shell.")
68DEF_SWITCH(DeviceVMServiceHost,
70 "The hostname/IP address on which the Dart VM Service should "
71 "be served. If not set, defaults to 127.0.0.1 or ::1 depending on "
72 "whether --
ipv6 is specified.")
73DEF_SWITCH(DeviceVMServicePort,
75 "A custom Dart VM Service port. The default is to pick a randomly "
76 "available open port.")
80 "Disable the Dart VM Service. The Dart VM Service is never available "
82DEF_SWITCH(DisableVMServicePublication,
83 "disable-vm-service-publication",
84 "Disable mDNS Dart VM Service publication.")
87 "
Bind to the IPv6 localhost address for the Dart VM Service. "
88 "Ignored if --vm-service-
host is set.")
89DEF_SWITCH(EnableDartProfiling,
90 "enable-
dart-profiling",
91 "Enable Dart profiling. Profiling information can be viewed from "
92 "Dart / Flutter DevTools.")
96 "Make the profiler discard new samples once the profiler sample buffer is "
97 "
full. When this flag is not set, the profiler sample buffer is used as a "
98 "ring buffer, meaning that once it is
full, new samples start overwriting "
99 "the oldest ones. This
switch is only meaningful when set in conjunction "
100 "with --enable-
dart-profiling.")
101DEF_SWITCH(EndlessTraceBuffer,
102 "endless-trace-buffer",
103 "Enable an endless trace buffer. The default is a ring buffer. "
104 "This is useful when very old events need to viewed. For example, "
105 "during application launch. Memory usage will continue to grow "
106 "indefinitely however.")
107DEF_SWITCH(EnableSoftwareRendering,
108 "enable-software-rendering",
109 "Enable rendering using the Skia software backend. This is useful "
110 "when testing Flutter on emulators. By default, Flutter will "
111 "attempt to either use OpenGL, Metal, or Vulkan.")
114 "Start app with an specific route defined on the framework")
115DEF_SWITCH(SkiaDeterministicRendering,
116 "skia-deterministic-rendering",
117 "Skips the call to SkGraphics::Init(), thus avoiding swapping out "
118 "some Skia function pointers based on available CPU features. This "
119 "is used to obtain 100% deterministic behavior in Skia rendering.")
120DEF_SWITCH(FlutterAssetsDir,
122 "
Path to the Flutter assets directory.")
124DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.")
125DEF_SWITCH(DisableServiceAuthCodes,
126 "disable-service-auth-codes",
127 "Disable the requirement for authentication codes for communicating"
128 " with the VM service.")
129DEF_SWITCH(EnableServicePortFallback,
130 "enable-service-port-fallback",
131 "Allow the VM service to fallback to automatic port selection if"
132 " binding to a specified port fails.")
133DEF_SWITCH(StartPaused,
135 "Start the application paused in the Dart debugger.")
136DEF_SWITCH(EnableCheckedMode, "enable-checked-mode", "Enable checked mode.")
137DEF_SWITCH(TraceStartup,
139 "Trace early application lifecycle. Automatically switches to an "
140 "endless trace buffer.")
143 "Trace Skia calls. This is useful when debugging the GPU threed."
144 "By default, Skia tracing is not enabled to reduce the number of "
146DEF_SWITCH(TraceSkiaAllowlist,
147 "trace-skia-allowlist",
148 "Filters out all Skia trace event categories except those that are "
149 "specified in this comma separated list.")
153 "Filters out all trace events except those that are specified in this "
154 "comma separated list of allowed prefixes.")
155DEF_SWITCH(DumpSkpOnShaderCompilation,
156 "dump-skp-on-shader-compilation",
157 "Automatically dump the skp that triggers new shader compilations. "
158 "This is useful for writing custom ShaderWarmUp to reduce jank. "
159 "By default, this is not enabled to reduce the overhead. ")
162 "Only cache the shader in SkSL instead of binary or GLSL. This "
163 "should only be used during development phases. The generated SkSLs "
164 "can later be used in the release build for shader precompilation "
165 "at launch in order to eliminate the shader-compile jank.")
166DEF_SWITCH(PurgePersistentCache,
167 "purge-persistent-cache",
168 "Remove all existing persistent cache. This is mainly for debugging "
169 "purposes such as reproducing the shader compilation jank.")
173 "Trace to the system tracer (instead of the timeline) on platforms where "
174 "such a tracer is available. Currently only supported on Android and "
176DEF_SWITCH(TraceToFile,
178 "Write the timeline trace to a file at the specified
path. The file "
179 "will be in Perfetto's proto format; it will be possible to load "
180 "the file into Perfetto's trace viewer.")
181DEF_SWITCH(ProfileMicrotasks,
182 "profile-microtasks",
183 "Enable collection of information about each microtask. Information "
184 "about completed microtasks will be written to the \"Microtask\" "
185 "timeline stream. Information about queued microtasks will be "
186 "accessible from Dart / Flutter DevTools.")
187DEF_SWITCH(UseTestFonts,
189 "Running tests that layout and measure
text will not yield "
190 "consistent results across various platforms. Enabling this option "
191 "will make font resolution default to the Ahem test font on all "
192 "platforms (See https:
193 "This option is only available on the desktop test shells.")
194DEF_SWITCH(DisableAssetFonts,
195 "disable-asset-
fonts",
196 "Prevents usage of any non-test
fonts unless they were explicitly "
197 "Loaded via
dart:
ui font APIs. This option is only available on the "
198 "desktop test shells.")
199DEF_SWITCH(PrefetchedDefaultFontManager,
201 "Indicates whether the embedding started a prefetch of the "
203DEF_SWITCH(VerboseLogging,
205 "By default, only errors are logged. This flag enabled logging at "
206 "all severity levels. This is NOT a per shell flag and affect log "
207 "levels for all shells in the process.")
208DEF_SWITCH(RunForever,
210 "In non-interactive mode, keep the shell running after the Dart "
211 "script has completed.")
212DEF_SWITCH(DisableDartAsserts,
213 "disable-
dart-asserts",
214 "Dart code runs with assertions enabled when the runtime mode is "
215 "debug. In profile and release product modes, assertions are "
216 "disabled. This flag may be specified if the user wishes to run "
217 "with assertions disabled in the debug product mode (
i.e. with JIT "
219DEF_SWITCH(EnableSerialGC,
221 "On low power devices with low core
counts, running concurrent "
222 "GC tasks on threads can cause them to contend with the UI thread "
223 "which could potentially lead to jank. This option turns off all "
224 "concurrent GC activities")
225DEF_SWITCH(DisallowInsecureConnections,
226 "disallow-insecure-connections",
227 "By default,
dart:io allows all socket connections. If this
switch "
228 "is set, all insecure connections are rejected.")
229DEF_SWITCH(DomainNetworkPolicy,
231 "JSON encoded network
policy per domain. This overrides the "
232 "DisallowInsecureConnections
switch. Embedder can specify whether "
233 "to allow or disallow insecure connections at a domain level.")
236 "force-multithreading",
237 "Uses separate threads for the platform, UI, GPU and IO task runners. "
238 "By default, a single thread is used for all task runners. Only available "
239 "in the flutter_tester.")
240DEF_SWITCH(OldGenHeapSize,
242 "The
size limit in megabytes for the Dart VM old gen heap space.")
244DEF_SWITCH(ResourceCacheMaxBytesThreshold,
245 "resource-cache-max-bytes-threshold",
246 "The max bytes threshold of resource cache, or 0 for unlimited.")
247DEF_SWITCH(EnableImpeller,
249 "Enable the Impeller renderer on supported platforms. Ignored if "
250 "Impeller is not supported on the platform.")
251DEF_SWITCH(ImpellerBackend,
253 "Requests a particular Impeller backend on platforms that support "
255DEF_SWITCH(EnableVulkanValidation,
258 "available to the application and loadable. On non-Vulkan
backends, "
259 "this flag does nothing.")
260DEF_SWITCH(EnableOpenGLGPUTracing,
261 "enable-opengl-gpu-tracing",
262 "Enable tracing of GPU execution time when using the Impeller "
264DEF_SWITCH(EnableVulkanGPUTracing,
266 "Enable tracing of GPU execution time when using the Impeller "
270 "When the last shell shuts down, the shared VM is leaked by default "
271 "(the leak_vm in VM settings is true). To clean up the leak VM, set "
272 "this value to false.")
273DEF_SWITCH(EnableEmbedderAPI,
274 "enable-embedder-api",
275 "Enable the embedder api. Defaults to false. iOS only.")
276DEF_SWITCH(EnablePlatformIsolates,
277 "enable-platform-isolates",
278 "Enable support for isolates that run on the platform thread.")
279DEF_SWITCH(MergedPlatformUIThread,
280 "merged-platform-
ui-thread",
281 "Sets whether the
ui thread and platform thread should be merged.")
284DEF_SWITCH(DisableMergedPlatformUIThread,
285 "no-enable-merged-platform-
ui-thread",
286 "Disables merging of the UI and platform threads.")
287DEF_SWITCH(EnableAndroidSurfaceControl,
288 "enable-surface-control",
289 "Enable the SurfaceControl backed swapchain when supported.")
290DEF_SWITCH(EnableFlutterGPU,
292 "Whether Flutter GPU is enabled.")
293DEF_SWITCH(ImpellerLazyShaderMode,
295 "Whether to defer initialization of all required PSOs for the "
296 "Impeller backend. Defaults to false.")
297DEF_SWITCH(ImpellerAntialiasLines,
299 "Experimental flag to test drawing lines with antialiasing.")
const FlutterLayer ** layers
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 counts
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is full
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
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 forever
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 The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan validation
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
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 manager
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 policy
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service host
DEF_SWITCHES_START aot vmservice shared library name
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 dart
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 gc
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode ipv6
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 The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan backends
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
it will be possible to load the file into Perfetto s trace viewer use test fonts
static bool Bind(PassBindingsCacheMTL &pass, ShaderStage stage, size_t bind_index, const BufferView &view)
#define DEF_SWITCH(swtch, flag, help)
#define DEF_SWITCHES_START