| Flutter Impeller |

Public Member Functions | List of all members
impeller::PlaygroundTest Class Reference

`#include <playground_test.h>`

Inheritance diagram for impeller::PlaygroundTest:

## Public Member Functions
| PlaygroundTest ()
virtual | ~PlaygroundTest ()
void | SetUp () override
void | TearDown () override
PlaygroundBackend | GetBackend () const
std::unique_ptr< fml::Mapping > | OpenAssetAsMapping (std::string asset_name) const override
RuntimeStage::Map | OpenAssetAsRuntimeStage (const char *asset_name) const
std::string | GetWindowTitle () const override
bool | BackendSupportsFragmentProgram () const
Public Member Functions inherited from impeller::Playground
| Playground (PlaygroundSwitches switches)
virtual | ~Playground ()
void | SetupContext (PlaygroundBackend backend)
void | SetupWindow ()
void | TeardownWindow ()
Point | GetCursorPosition () const
ISize | GetWindowSize () const
Point | GetContentScale () const
Scalar | GetSecondsElapsed () const
| Get the amount of time elapsed from the start of the playground's execution. More...
std::shared_ptr< Context > | GetContext () const
bool | OpenPlaygroundHere (const Renderer::RenderCallback &render_callback)
bool | OpenPlaygroundHere (SinglePassCallback pass_callback)
std::shared_ptr< Texture > | CreateTextureForFixture (const char *fixture_name, bool enable_mipmapping=false) const
std::shared_ptr< Texture > | CreateTextureCubeForFixture (std::array< const char *, 6 > fixture_names) const
fml::Status | SetCapabilities (const std::shared_ptr< Capabilities > &capabilities)
bool | WillRenderSomething () const

## Additional Inherited Members
Public Types inherited from impeller::Playground
using | SinglePassCallback = std::function< bool(RenderPass &pass)>
Static Public Member Functions inherited from impeller::Playground
static bool | ShouldOpenNewPlaygrounds ()
static std::shared_ptr< CompressedImage > | LoadFixtureImageCompressed (std::shared_ptr< fml::Mapping > mapping)
static std::optional< DecompressedImage > | DecodeImageRGBA (const std::shared_ptr< CompressedImage > &compressed)
static std::shared_ptr< Texture > | CreateTextureForMapping (const std::shared_ptr< Context > &context, std::shared_ptr< fml::Mapping > mapping, bool enable_mipmapping=false)
static bool | SupportsBackend (PlaygroundBackend backend)
Protected Member Functions inherited from impeller::Playground
void | SetWindowSize (ISize size)
Protected Attributes inherited from impeller::Playground
const PlaygroundSwitches | switches_

## Detailed Description

Definition at line 23 of file playground_test.h.

## Constructor & Destructor Documentation

## ◆ PlaygroundTest()

impeller::PlaygroundTest::PlaygroundTest | ( |  | ) |

Definition at line 13 of file playground_test.cc.

14 : Playground(PlaygroundSwitches{flutter::testing::GetArgsForProcess()}) {}

## ◆ ~PlaygroundTest()

impeller::PlaygroundTest::~PlaygroundTest | ( |  | ) |
| virtual default

## Member Function Documentation

## ◆ BackendSupportsFragmentProgram()

bool impeller::PlaygroundTest::BackendSupportsFragmentProgram | ( |  | ) | const
| inline

Definition at line 47 of file playground_test.h.

47 {
48 return GetBackend() != PlaygroundBackend::kVulkan;
49 }

References GetBackend(), and impeller::kVulkan.

## ◆ GetBackend()

PlaygroundBackend impeller::PlaygroundTest::GetBackend | ( |  | ) | const

Definition at line 35 of file playground_test.cc.

35 {
36 return GetParam();
37 }

Referenced by BackendSupportsFragmentProgram().

## ◆ GetWindowTitle()

std::string impeller::PlaygroundTest::GetWindowTitle | ( |  | ) | const
| override virtual

Implements impeller::Playground.

Definition at line 66 of file playground_test.cc.

66 {
67 return FormatWindowTitle(flutter::testing::GetCurrentTestName());
68 }

References impeller::FormatWindowTitle().

## ◆ OpenAssetAsMapping()

std::unique_ptr< fml::Mapping > impeller::PlaygroundTest::OpenAssetAsMapping | ( | std::string | asset_name | ) | const
| override virtual

Implements impeller::Playground.

Definition at line 44 of file playground_test.cc.

45 {
46 return flutter::testing::OpenFixtureAsMapping(asset_name);
47 }

## ◆ OpenAssetAsRuntimeStage()

RuntimeStage::Map impeller::PlaygroundTest::OpenAssetAsRuntimeStage | ( | const char * | asset_name | ) | const

Definition at line 49 of file playground_test.cc.

50 {
51 const std::shared_ptr<fml::Mapping> fixture =
52 flutter::testing::OpenFixtureAsMapping(asset_name);
53 if (!fixture || fixture->GetSize() == 0) {
54 return {};
55 }
56 return RuntimeStage::DecodeRuntimeStages(fixture);
57 }

References impeller::RuntimeStage::DecodeRuntimeStages().

## ◆ SetUp()

void impeller::PlaygroundTest::SetUp | ( |  | ) |
| override

Definition at line 18 of file playground_test.cc.

18 {
19 if (!Playground::SupportsBackend(GetParam())) {
20 GTEST_SKIP_("Playground doesn't support this backend type.");
21 return;
22 }
23
24 if (!Playground::ShouldOpenNewPlaygrounds()) {
25 GTEST_SKIP_("Skipping due to user action.");
26 return;
27 }
28
29 ImpellerValidationErrorsSetFatal(true);
30
31 SetupContext(GetParam());
32 SetupWindow();
33 }

References impeller::ImpellerValidationErrorsSetFatal(), impeller::Playground::SetupContext(), impeller::Playground::SetupWindow(), impeller::Playground::ShouldOpenNewPlaygrounds(), and impeller::Playground::SupportsBackend().

## ◆ TearDown()

void impeller::PlaygroundTest::TearDown | ( |  | ) |
| override

Definition at line 39 of file playground_test.cc.

39 {
40 TeardownWindow();
41 }

References impeller::Playground::TeardownWindow().

Referenced by impeller::AiksPlayground::TearDown().

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

- impeller/playground/playground_test.h
- impeller/playground/playground_test.cc

impeller::Playground::ShouldOpenNewPlaygrounds
static bool ShouldOpenNewPlaygrounds()
Definition: playground.cc:152
impeller::PlaygroundBackend::kVulkan
@ kVulkan
impeller::RuntimeStage::DecodeRuntimeStages
static Map DecodeRuntimeStages(const std::shared_ptr< fml::Mapping > &payload)
Definition: runtime_stage.cc:72
impeller::FormatWindowTitle
static std::string FormatWindowTitle(const std::string &test_name)
Definition: compute_playground_test.cc:44
impeller::Playground::SetupWindow
void SetupWindow()
Definition: playground.cc:126
impeller::ImpellerValidationErrorsSetFatal
void ImpellerValidationErrorsSetFatal(bool fatal)
Definition: validation.cc:16
impeller::Playground::SetupContext
void SetupContext(PlaygroundBackend backend)
Definition: playground.cc:114
impeller::Playground::SupportsBackend
static bool SupportsBackend(PlaygroundBackend backend)
Definition: playground.cc:90
impeller::Playground::TeardownWindow
void TeardownWindow()
Definition: playground.cc:141
impeller::Playground::Playground
Playground(PlaygroundSwitches switches)
Definition: playground.cc:80
impeller::PlaygroundTest::GetBackend
PlaygroundBackend GetBackend() const
Definition: playground_test.cc:35