| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::PlaygroundSwitches Struct Reference

`#include <switches.h>`

## Public Member Functions
| PlaygroundSwitches ()
| PlaygroundSwitches (const fml::CommandLine &args)

## Public Attributes
bool | enable_playground = false
std::optional< std::chrono::milliseconds > | timeout
bool | enable_vulkan_validation = false
bool | use_swiftshader = false
bool | use_angle = false
bool | enable_wide_gamut = false

## Detailed Description

Definition at line 15 of file switches.h.

## Constructor & Destructor Documentation

## ◆ PlaygroundSwitches() [1/2]

impeller::PlaygroundSwitches::PlaygroundSwitches | ( |  | ) |
| default

## ◆ PlaygroundSwitches() [2/2]

impeller::PlaygroundSwitches::PlaygroundSwitches | ( | const fml::CommandLine & | args | ) |
| explicit

Definition at line 15 of file switches.cc.

15 {
16 enable_playground = args.HasOption("enable_playground");
17 std::string timeout_str;
18 if (args.GetOptionValue("playground_timeout_ms", &timeout_str)) {
19 timeout = std::chrono::milliseconds(atoi(timeout_str.c_str()));
20 // Specifying a playground timeout implies you want to enable playgrounds.
21 enable_playground = true;
22 }
23 enable_vulkan_validation = args.HasOption("enable_vulkan_validation");
24 use_swiftshader = args.HasOption("use_swiftshader");
25 use_angle = args.HasOption("use_angle");
26 #if FML_OS_MACOSX
27 // OpenGL on macOS is busted and deprecated. Use Angle there by default.
28 use_angle = true;
29 #endif // FML_OS_MACOSX
30 }

References enable_playground, enable_vulkan_validation, timeout, use_angle, and use_swiftshader.

## Member Data Documentation

## ◆ enable_playground

bool impeller::PlaygroundSwitches::enable_playground = false

Definition at line 16 of file switches.h.

Referenced by impeller::Playground::IsPlaygroundEnabled(), impeller::EntityPlayground::OpenPlaygroundHere(), impeller::DlPlayground::OpenPlaygroundHere(), impeller::Playground::OpenPlaygroundHere(), PlaygroundSwitches(), and impeller::Playground::WillRenderSomething().

## ◆ enable_vulkan_validation

bool impeller::PlaygroundSwitches::enable_vulkan_validation = false

Definition at line 21 of file switches.h.

Referenced by impeller::PlaygroundImpl::Create(), impeller::PlaygroundImplVK::PlaygroundImplVK(), and PlaygroundSwitches().

## ◆ enable_wide_gamut

bool impeller::PlaygroundSwitches::enable_wide_gamut = false

Definition at line 35 of file switches.h.

Referenced by impeller::testing::MetalScreenshotter::MetalScreenshotter(), impeller::PlaygroundImplMTL::PlaygroundImplMTL(), and impeller::PlaygroundTest::SetUp().

## ◆ timeout

std::optional<std::chrono::milliseconds> impeller::PlaygroundSwitches::timeout

Definition at line 20 of file switches.h.

Referenced by PlaygroundSwitches().

## ◆ use_angle

bool impeller::PlaygroundSwitches::use_angle = false

Attempt to use Angle on the system instead of the available OpenGL ES implementation. This is on-by-default on macOS due to the broken-ness in the deprecated OpenGL implementation. On other platforms, it this opt-in via the flag with the system OpenGL ES implementation used by fault.

Definition at line 33 of file switches.h.

Referenced by impeller::PlaygroundTest::GetWindowTitle(), PlaygroundSwitches(), and impeller::GoldenPlaygroundTest::SetUp().

## ◆ use_swiftshader

bool impeller::PlaygroundSwitches::use_swiftshader = false

Seek a SwiftShader library in known locations and use it when running Vulkan. It is a fatal error to provide this option and not have the test find a SwiftShader implementation.

Definition at line 27 of file switches.h.

Referenced by impeller::PlaygroundTest::GetWindowTitle(), impeller::Playground::Playground(), and PlaygroundSwitches().

The documentation for this struct was generated from the following files:

- impeller/playground/switches.h
- impeller/playground/switches.cc

impeller::PlaygroundSwitches::use_swiftshader
bool use_swiftshader
Definition: switches.h:27
impeller::PlaygroundSwitches::timeout
std::optional< std::chrono::milliseconds > timeout
Definition: switches.h:20
impeller::PlaygroundSwitches::use_angle
bool use_angle
Definition: switches.h:33
impeller::PlaygroundSwitches::enable_vulkan_validation
bool enable_vulkan_validation
Definition: switches.h:21
impeller::PlaygroundSwitches::enable_playground
bool enable_playground
Definition: switches.h:16