| 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
std::shared_ptr< RuntimeStage > | OpenAssetAsRuntimeStage (const char *asset_name) const
std::string | GetWindowTitle () const override
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

## 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 Attributes inherited from impeller::Playground
const PlaygroundSwitches | switches_

## Detailed Description

Definition at line 22 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

## ◆ GetBackend()

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

Definition at line 35 of file playground_test.cc.

35 {
36 return GetParam();
37 }

## ◆ GetWindowTitle()

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

Implements impeller::Playground.

Definition at line 69 of file playground_test.cc.

69 {
70 return FormatWindowTitle(flutter::testing::GetCurrentTestName());
71 }

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()

std::shared_ptr< RuntimeStage > impeller::PlaygroundTest::OpenAssetAsRuntimeStage | ( | const char * | asset_name | ) | const

Definition at line 49 of file playground_test.cc.

50 {
51 auto fixture = flutter::testing::OpenFixtureAsMapping(asset_name);
52 if (!fixture || fixture->GetSize() == 0) {
53 return nullptr;
54 }
55 auto stage = std::make_unique<RuntimeStage>(std::move(fixture));
56 if (!stage->IsValid()) {
57 return nullptr;
58 }
59 return stage;
60 }

## ◆ 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::FormatWindowTitle
static std::string FormatWindowTitle(const std::string &test_name)
Definition: compute_playground_test.cc:57
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