#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) |
| bool | PlatformSupportsWideGamutTests () const |
| void | EnsureContextIsUnique () |
| bool | EnsureContextSupportsWideGamut () |
| void | EnsureContextSupportsAntialiasLines () |
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 360 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 347 of file golden_playground_test_mac.cc.
References impeller::Playground::CreateTextureForMapping(), GetContext(), and flutter::testing::OpenFixtureAsMapping().
Referenced by CreateDlImageForFixture().
|
inlineprotected |
Definition at line 117 of file golden_playground_test.h.
|
inlineprotected |
Definition at line 125 of file golden_playground_test.h.
|
inlineprotected |
Definition at line 121 of file golden_playground_test.h.
| PlaygroundBackend impeller::GoldenPlaygroundTest::GetBackend | ( | ) | const |
Definition at line 265 of file golden_playground_test_mac.cc.
| Point impeller::GoldenPlaygroundTest::GetContentScale | ( | ) | const |
Definition at line 414 of file golden_playground_test_mac.cc.
| std::shared_ptr< Context > impeller::GoldenPlaygroundTest::GetContext | ( | ) | const |
Definition at line 378 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 452 of file golden_playground_test_mac.cc.
| Scalar impeller::GoldenPlaygroundTest::GetSecondsElapsed | ( | ) | const |
Definition at line 418 of file golden_playground_test_mac.cc.
| IRect impeller::GoldenPlaygroundTest::GetWindowBounds | ( | ) | const |
Definition at line 426 of file golden_playground_test_mac.cc.
References impeller::TRect< T >::MakeSize().
| ISize impeller::GoldenPlaygroundTest::GetWindowSize | ( | ) | const |
Definition at line 422 of file golden_playground_test_mac.cc.
|
static |
Definition at line 341 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 385 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 439 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 368 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 269 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 294 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 289 of file golden_playground_test_mac.cc.
References OpenPlaygroundHere().
| bool impeller::GoldenPlaygroundTest::OpenPlaygroundHere | ( | Picture | picture | ) |
Referenced by OpenPlaygroundHere().
|
protected |
Definition at line 187 of file golden_playground_test_mac.cc.
References impeller::kMetal.
|
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 434 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 191 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.