#include <golden_playground_test.h>
Classes | |
| struct | GoldenPlaygroundTestImpl |
Public Types | |
| using | AiksPlaygroundCallback = std::function< std::optional< Picture >(AiksContext &renderer)> |
| using | AiksDlPlaygroundCallback = std::function< sk_sp< flutter::DisplayList >()> |
Public Member Functions | |
| GoldenPlaygroundTest () | |
| ~GoldenPlaygroundTest () override | |
| void | SetUp () |
| void | TearDown () |
| PlaygroundBackend | GetBackend () const |
| void | SetTypographerContext (std::shared_ptr< TypographerContext > typographer_context) |
| bool | OpenPlaygroundHere (Picture picture) |
| bool | OpenPlaygroundHere (AiksPlaygroundCallback callback) |
| bool | OpenPlaygroundHere (const AiksDlPlaygroundCallback &callback) |
| bool | OpenPlaygroundHere (const sk_sp< flutter::DisplayList > &list) |
| bool | OpenPlaygroundHere (const Playground::SinglePassCallback &callback) |
| std::unique_ptr< testing::Screenshot > | MakeScreenshot (const sk_sp< flutter::DisplayList > &list) |
| std::shared_ptr< Texture > | CreateTextureForFixture (const char *fixture_name, bool enable_mipmapping=false) const |
| sk_sp< flutter::DlImage > | CreateDlImageForFixture (const char *fixture_name, bool enable_mipmapping=false) const |
| absl::StatusOr< RuntimeStage::Map > | OpenAssetAsRuntimeStage (const char *asset_name) const |
| std::shared_ptr< Context > | GetContext () const |
| std::shared_ptr< Context > | MakeContext () const |
| Point | GetContentScale () const |
| Scalar | GetSecondsElapsed () const |
| ISize | GetWindowSize () const |
| IRect | GetWindowBounds () const |
| fml::Status | SetCapabilities (const std::shared_ptr< Capabilities > &capabilities) |
| bool | WillRenderSomething () const |
Returns true if OpenPlaygroundHere will actually render anything. | |
| RuntimeStageBackend | GetRuntimeStageBackend () const |
| bool | IsGoldenTest () |
Static Public Member Functions | |
| static bool | SaveScreenshot (std::unique_ptr< testing::Screenshot > screenshot, const std::string &postfix="") |
| static bool | ImGuiBegin (const char *name, bool *p_open, ImGuiWindowFlags flags) |
Protected Member Functions | |
| void | SetWindowSize (ISize size) |
Definition at line 27 of file golden_playground_test.h.
| using impeller::GoldenPlaygroundTest::AiksDlPlaygroundCallback = std::function<sk_sp<flutter::DisplayList>()> |
Definition at line 33 of file golden_playground_test.h.
| using impeller::GoldenPlaygroundTest::AiksPlaygroundCallback = std::function<std::optional<Picture>(AiksContext& renderer)> |
Definition at line 30 of file golden_playground_test.h.
|
default |
Definition at line 126 of file golden_playground_test_mac.cc.
|
overridedefault |
| sk_sp< flutter::DlImage > impeller::GoldenPlaygroundTest::CreateDlImageForFixture | ( | const char * | fixture_name, |
| bool | enable_mipmapping = false |
||
| ) | const |
Definition at line 323 of file golden_playground_test_mac.cc.
References CreateTextureForFixture(), impeller::DlImageImpeller::Make(), and texture.
| std::shared_ptr< Texture > impeller::GoldenPlaygroundTest::CreateTextureForFixture | ( | const char * | fixture_name, |
| bool | enable_mipmapping = false |
||
| ) | const |
Definition at line 310 of file golden_playground_test_mac.cc.
References impeller::Playground::CreateTextureForMapping(), GetContext(), and flutter::testing::OpenFixtureAsMapping().
Referenced by CreateDlImageForFixture().
| PlaygroundBackend impeller::GoldenPlaygroundTest::GetBackend | ( | ) | const |
Definition at line 228 of file golden_playground_test_mac.cc.
| Point impeller::GoldenPlaygroundTest::GetContentScale | ( | ) | const |
Definition at line 367 of file golden_playground_test_mac.cc.
| std::shared_ptr< Context > impeller::GoldenPlaygroundTest::GetContext | ( | ) | const |
Definition at line 341 of file golden_playground_test_mac.cc.
Referenced by CreateTextureForFixture(), MakeContext(), MakeScreenshot(), OpenPlaygroundHere(), OpenPlaygroundHere(), SetUp(), and TearDown().
| RuntimeStageBackend impeller::GoldenPlaygroundTest::GetRuntimeStageBackend | ( | ) | const |
Definition at line 405 of file golden_playground_test_mac.cc.
| Scalar impeller::GoldenPlaygroundTest::GetSecondsElapsed | ( | ) | const |
Definition at line 371 of file golden_playground_test_mac.cc.
| IRect impeller::GoldenPlaygroundTest::GetWindowBounds | ( | ) | const |
Definition at line 379 of file golden_playground_test_mac.cc.
References impeller::TRect< T >::MakeSize().
| ISize impeller::GoldenPlaygroundTest::GetWindowSize | ( | ) | const |
Definition at line 375 of file golden_playground_test_mac.cc.
|
static |
Definition at line 304 of file golden_playground_test_mac.cc.
|
inline |
Definition at line 107 of file golden_playground_test.h.
| std::shared_ptr< Context > impeller::GoldenPlaygroundTest::MakeContext | ( | ) | const |
On Metal we create a context for each test.
On OpenGL we create a context for each test.
Definition at line 348 of file golden_playground_test_mac.cc.
References FML_CHECK, GetContext(), impeller::kMetal, and impeller::kVulkan.
| std::unique_ptr< testing::Screenshot > impeller::GoldenPlaygroundTest::MakeScreenshot | ( | const sk_sp< flutter::DisplayList > & | list | ) |
Definition at line 392 of file golden_playground_test_mac.cc.
References impeller::DisplayListToTexture(), GetContext(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
| absl::StatusOr< RuntimeStage::Map > impeller::GoldenPlaygroundTest::OpenAssetAsRuntimeStage | ( | const char * | asset_name | ) | const |
Definition at line 331 of file golden_playground_test_mac.cc.
References impeller::RuntimeStage::DecodeRuntimeStages(), and flutter::testing::OpenFixtureAsMapping().
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | AiksPlaygroundCallback | callback | ) |
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | const AiksDlPlaygroundCallback & | callback | ) |
Definition at line 232 of file golden_playground_test_mac.cc.
References callback, impeller::DisplayListToTexture(), GetContext(), i, SaveScreenshot(), texture, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | const Playground::SinglePassCallback & | callback | ) |
Renders callback into an offscreen render pass and saves the result as a golden image. The render target is single-sampled, uses the context's default color format, and has no depth or stencil attachment, so a pipeline built from PipelineBuilder<>::MakeDefaultPipelineDescriptor must be reduced to match by calling SetSampleCount(kCount1), ClearStencilAttachments(), and ClearDepthAttachment() on it. Calling only SetStencilAttachmentDescriptors(nullopt) leaves the stencil pixel format set and trips Metal's render pipeline validation.
Definition at line 257 of file golden_playground_test_mac.cc.
References callback, impeller::RenderTargetAllocator::CreateOffscreen(), GetContext(), impeller::RenderTarget::GetRenderTargetTexture(), i, impeller::RenderTarget::IsValid(), impeller::RenderTarget::kDefaultColorAttachmentConfig, SaveScreenshot(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | const sk_sp< flutter::DisplayList > & | list | ) |
Definition at line 252 of file golden_playground_test_mac.cc.
References OpenPlaygroundHere().
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | Picture | picture | ) |
Referenced by OpenPlaygroundHere().
|
static |
Definition at line 100 of file golden_playground_test_mac.cc.
References impeller::testing::GoldenDigest::AddImage(), FML_LOG, impeller::testing::WorkingDirectory::GetFilenamePath(), impeller::testing::GoldenDigest::Instance(), and impeller::testing::WorkingDirectory::Instance().
Referenced by OpenPlaygroundHere(), and OpenPlaygroundHere().
| fml::Status impeller::GoldenPlaygroundTest::SetCapabilities | ( | const std::shared_ptr< Capabilities > & | capabilities | ) |
Definition at line 387 of file golden_playground_test_mac.cc.
| void impeller::GoldenPlaygroundTest::SetTypographerContext | ( | std::shared_ptr< TypographerContext > | typographer_context | ) |
Definition at line 132 of file golden_playground_test_mac.cc.
| void impeller::GoldenPlaygroundTest::SetUp | ( | ) |
Definition at line 156 of file golden_playground_test_mac.cc.
References impeller::testing::GoldenDigest::AddDimension(), impeller::Flags::antialiased_lines, impeller::PlaygroundImpl::Create(), impeller::PlaygroundSwitches::enable_wide_gamut, impeller::PlaygroundSwitches::flags, FML_CHECK, GetContext(), flutter::testing::GetTestingAssetsPath(), GLFW_TRUE, impeller::testing::GoldenDigest::Instance(), impeller::kMetal, impeller::kMetalSDF, impeller::kOpenGLES, impeller::kSkipTests, impeller::kVulkan, impeller::PlaygroundSwitches::use_angle, and impeller::Flags::use_sdfs.
|
protected |
Definition at line 76 of file golden_playground_test_stub.cc.
| void impeller::GoldenPlaygroundTest::TearDown | ( | ) |
Definition at line 137 of file golden_playground_test_mac.cc.
References GetContext().
|
inline |
Returns true if OpenPlaygroundHere will actually render anything.
Definition at line 103 of file golden_playground_test.h.