#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 157 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 356 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 343 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 261 of file golden_playground_test_mac.cc.
| Point impeller::GoldenPlaygroundTest::GetContentScale | ( | ) | const |
Definition at line 410 of file golden_playground_test_mac.cc.
| std::shared_ptr< Context > impeller::GoldenPlaygroundTest::GetContext | ( | ) | const |
Definition at line 374 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 448 of file golden_playground_test_mac.cc.
| Scalar impeller::GoldenPlaygroundTest::GetSecondsElapsed | ( | ) | const |
Definition at line 414 of file golden_playground_test_mac.cc.
| IRect impeller::GoldenPlaygroundTest::GetWindowBounds | ( | ) | const |
Definition at line 422 of file golden_playground_test_mac.cc.
References impeller::TRect< T >::MakeSize().
| ISize impeller::GoldenPlaygroundTest::GetWindowSize | ( | ) | const |
Definition at line 418 of file golden_playground_test_mac.cc.
|
static |
Definition at line 337 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.
Definition at line 381 of file golden_playground_test_mac.cc.
References FML_CHECK, GetContext(), impeller::kMetal, impeller::kMetalSDF, impeller::kOpenGLES, impeller::kOpenGLESSDF, and impeller::kVulkan.
| std::unique_ptr< testing::Screenshot > impeller::GoldenPlaygroundTest::MakeScreenshot | ( | const sk_sp< flutter::DisplayList > & | list | ) |
Definition at line 435 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 364 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 265 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 290 of file golden_playground_test_mac.cc.
References callback, command_buffer, context, impeller::RenderTargetAllocator::CreateOffscreen(), GetContext(), impeller::RenderTarget::GetRenderTargetTexture(), i, impeller::RenderTarget::IsValid(), impeller::RenderTarget::kDefaultColorAttachmentConfig, render_pass, SaveScreenshot(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | const sk_sp< flutter::DisplayList > & | list | ) |
Definition at line 285 of file golden_playground_test_mac.cc.
References OpenPlaygroundHere().
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | Picture | picture | ) |
Referenced by OpenPlaygroundHere().
|
static |
Definition at line 131 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 430 of file golden_playground_test_mac.cc.
| void impeller::GoldenPlaygroundTest::SetTypographerContext | ( | std::shared_ptr< TypographerContext > | typographer_context | ) |
Definition at line 163 of file golden_playground_test_mac.cc.
| void impeller::GoldenPlaygroundTest::SetUp | ( | ) |
Definition at line 187 of file golden_playground_test_mac.cc.
References impeller::testing::GoldenDigest::AddDimension(), impeller::Flags::antialiased_lines, impeller::PlaygroundSwitches::enable_wide_gamut, impeller::PlaygroundSwitches::flags, GetContext(), flutter::testing::GetTestingAssetsPath(), impeller::testing::GoldenDigest::Instance(), impeller::kMetal, impeller::kMetalSDF, impeller::kOpenGLES, impeller::kOpenGLESSDF, impeller::kSkipTests, impeller::kVulkan, and impeller::Flags::use_sdfs.
|
protected |
Definition at line 80 of file golden_playground_test_stub.cc.
| void impeller::GoldenPlaygroundTest::TearDown | ( | ) |
Definition at line 168 of file golden_playground_test_mac.cc.
References context, and GetContext().
|
inline |
Returns true if OpenPlaygroundHere will actually render anything.
Definition at line 103 of file golden_playground_test.h.