#include <playground.h>
Public Types | |
using | SinglePassCallback = std::function< bool(RenderPass &pass)> |
Public Member Functions | |
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 |
std::shared_ptr< Context > | MakeContext () 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 |
virtual std::unique_ptr< fml::Mapping > | OpenAssetAsMapping (std::string asset_name) const =0 |
virtual std::string | GetWindowTitle () const =0 |
fml::Status | SetCapabilities (const std::shared_ptr< Capabilities > &capabilities) |
bool | WillRenderSomething () const |
Static Public Member Functions | |
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 | |
virtual bool | ShouldKeepRendering () const |
void | SetWindowSize (ISize size) |
Protected Attributes | |
const PlaygroundSwitches | switches_ |
Definition at line 50 of file playground.h.
using impeller::Playground::SinglePassCallback = std::function<bool(RenderPass& pass)> |
Definition at line 52 of file playground.h.
|
explicit |
Definition at line 82 of file playground.cc.
References impeller::InitializeGLFWOnce(), impeller::SetupSwiftshaderOnce(), switches_, and impeller::PlaygroundSwitches::use_swiftshader.
|
virtualdefault |
std::shared_ptr< Texture > impeller::Playground::CreateTextureCubeForFixture | ( | std::array< const char *, 6 > | fixture_names | ) | const |
Definition at line 462 of file playground.cc.
References DecodeImageRGBA(), impeller::kHostVisible, impeller::kR8G8B8A8UNormInt, impeller::kTextureCube, LoadFixtureImageCompressed(), OpenAssetAsMapping(), impeller::TextureDescriptor::storage_mode, and VALIDATION_LOG.
std::shared_ptr< Texture > impeller::Playground::CreateTextureForFixture | ( | const char * | fixture_name, |
bool | enable_mipmapping = false |
||
) | const |
Definition at line 449 of file playground.cc.
References CreateTextureForMapping(), and OpenAssetAsMapping().
|
static |
Definition at line 436 of file playground.cc.
References impeller::CreateTextureForDecompressedImage(), DecodeImageRGBA(), and LoadFixtureImageCompressed().
Referenced by impeller::GoldenPlaygroundTest::CreateTextureForFixture(), and CreateTextureForFixture().
|
static |
Definition at line 374 of file playground.cc.
References VALIDATION_LOG.
Referenced by CreateTextureCubeForFixture(), and CreateTextureForMapping().
Point impeller::Playground::GetContentScale | ( | ) | const |
Definition at line 186 of file playground.cc.
Referenced by impeller::testing::CanRenderConicalGradientWithDithering(), impeller::testing::CanRenderSweepGradientWithDithering(), and impeller::testing::MaskBlurVariantTest().
std::shared_ptr< Context > impeller::Playground::GetContext | ( | ) | const |
Definition at line 89 of file playground.cc.
Referenced by impeller::EntityPlayground::GetContentContext(), impeller::testing::RendererDartTest::GetIsolate(), impeller::DlPlayground::OpenPlaygroundHere(), impeller::EntityPlayground::OpenPlaygroundHere(), impeller::AiksPlayground::OpenPlaygroundHere(), OpenPlaygroundHere(), and impeller::RuntimeStagePlayground::RegisterStage().
Point impeller::Playground::GetCursorPosition | ( | ) | const |
Definition at line 178 of file playground.cc.
Scalar impeller::Playground::GetSecondsElapsed | ( | ) | const |
Get the amount of time elapsed from the start of the playground's execution.
Definition at line 190 of file playground.cc.
ISize impeller::Playground::GetWindowSize | ( | ) | const |
Definition at line 182 of file playground.cc.
Referenced by OpenPlaygroundHere().
|
pure virtual |
Implemented in impeller::PlaygroundTest, and impeller::ComputePlaygroundTest.
Referenced by OpenPlaygroundHere().
|
static |
Definition at line 363 of file playground.cc.
References impeller::CompressedImageSkia::Create(), and VALIDATION_LOG.
Referenced by CreateTextureCubeForFixture(), and CreateTextureForMapping().
std::shared_ptr< Context > impeller::Playground::MakeContext | ( | ) | const |
Definition at line 93 of file playground.cc.
|
pure virtual |
Implemented in impeller::PlaygroundTest, and impeller::ComputePlaygroundTest.
Referenced by CreateTextureCubeForFixture(), and CreateTextureForFixture().
bool impeller::Playground::OpenPlaygroundHere | ( | const Renderer::RenderCallback & | render_callback | ) |
Definition at line 198 of file playground.cc.
References impeller::PlaygroundSwitches::enable_playground, GetWindowSize(), GetWindowTitle(), ImGui_ImplImpeller_Init(), ImGui_ImplImpeller_RenderDrawData(), ImGui_ImplImpeller_Shutdown(), impeller::kLoad, impeller::kStore, impeller::TSize< T >::Max(), impeller::PlaygroundKeyCallback(), SetWindowSize(), ShouldKeepRendering(), switches_, and VALIDATION_LOG.
Referenced by impeller::DlPlayground::OpenPlaygroundHere(), impeller::EntityPlayground::OpenPlaygroundHere(), impeller::AiksPlayground::OpenPlaygroundHere(), and OpenPlaygroundHere().
bool impeller::Playground::OpenPlaygroundHere | ( | SinglePassCallback | pass_callback | ) |
fml::Status impeller::Playground::SetCapabilities | ( | const std::shared_ptr< Capabilities > & | capabilities | ) |
Definition at line 510 of file playground.cc.
void impeller::Playground::SetupContext | ( | PlaygroundBackend | backend | ) |
Definition at line 123 of file playground.cc.
References impeller::PlaygroundImpl::Create(), SupportsBackend(), and switches_.
Referenced by impeller::ComputePlaygroundTest::SetUp(), and impeller::PlaygroundTest::SetUp().
void impeller::Playground::SetupWindow | ( | ) |
Definition at line 135 of file playground.cc.
Referenced by impeller::ComputePlaygroundTest::SetUp(), and impeller::PlaygroundTest::SetUp().
|
protected |
Definition at line 502 of file playground.cc.
Referenced by OpenPlaygroundHere().
|
protectedvirtual |
Definition at line 506 of file playground.cc.
Referenced by OpenPlaygroundHere().
|
static |
Definition at line 161 of file playground.cc.
References impeller::gShouldOpenNewPlaygrounds.
Referenced by impeller::ComputePlaygroundTest::SetUp(), and impeller::PlaygroundTest::SetUp().
|
static |
Definition at line 99 of file playground.cc.
References impeller::PlaygroundImplVK::IsVulkanDriverPresent(), impeller::kMetal, impeller::kOpenGLES, and impeller::kVulkan.
Referenced by impeller::ComputePlaygroundTest::SetUp(), impeller::PlaygroundTest::SetUp(), and SetupContext().
void impeller::Playground::TeardownWindow | ( | ) |
Definition at line 150 of file playground.cc.
Referenced by impeller::ComputePlaygroundTest::TearDown(), and impeller::PlaygroundTest::TearDown().
bool impeller::Playground::WillRenderSomething | ( | ) | const |
TODO(https://github.com/flutter/flutter/issues/139950): Remove this. Returns true if OpenPlaygroundHere
will actually render anything.
Definition at line 515 of file playground.cc.
References impeller::PlaygroundSwitches::enable_playground, and switches_.
|
protected |
Definition at line 117 of file playground.h.
Referenced by impeller::PlaygroundTest::GetWindowTitle(), impeller::DlPlayground::OpenPlaygroundHere(), impeller::EntityPlayground::OpenPlaygroundHere(), impeller::AiksPlayground::OpenPlaygroundHere(), OpenPlaygroundHere(), Playground(), SetupContext(), and WillRenderSomething().