5 #ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_PLAYGROUND_TEST_H_
6 #define FLUTTER_IMPELLER_GOLDEN_TESTS_GOLDEN_PLAYGROUND_TEST_H_
10 #include "flutter/display_list/display_list.h"
11 #include "flutter/display_list/image/dl_image.h"
16 #include "flutter/testing/testing.h"
18 #include "third_party/imgui/imgui.h"
21 #include "flutter/fml/platform/darwin/scoped_nsautorelease_pool.h"
27 :
public ::testing::TestWithParam<PlaygroundBackend> {
30 std::function<std::optional<Picture>(
AiksContext& renderer)>;
45 std::shared_ptr<TypographerContext> typographer_context);
56 const sk_sp<flutter::DisplayList>& list);
58 static bool SaveScreenshot(std::unique_ptr<testing::Screenshot> screenshot,
59 const std::string& postfix =
"");
63 ImGuiWindowFlags flags);
66 const char* fixture_name,
67 bool enable_mipmapping =
false)
const;
70 const char* fixture_name,
71 bool enable_mipmapping =
false)
const;
86 const std::shared_ptr<Capabilities>& capabilities);
98 fml::ScopedNSAutoreleasePool autorelease_pool_;
101 std::shared_ptr<TypographerContext> typographer_context_;
103 struct GoldenPlaygroundTestImpl;
105 std::shared_ptr<GoldenPlaygroundTestImpl> pimpl_;
bool OpenPlaygroundHere(AiksPlaygroundCallback callback)
PlaygroundBackend GetBackend() const
ISize GetWindowSize() const
std::function< std::optional< Picture >(AiksContext &renderer)> AiksPlaygroundCallback
sk_sp< flutter::DlImage > CreateDlImageForFixture(const char *fixture_name, bool enable_mipmapping=false) const
Point GetContentScale() const
fml::Status SetCapabilities(const std::shared_ptr< Capabilities > &capabilities)
void SetTypographerContext(std::shared_ptr< TypographerContext > typographer_context)
std::shared_ptr< Context > MakeContext() const
static bool SaveScreenshot(std::unique_ptr< testing::Screenshot > screenshot, const std::string &postfix="")
std::unique_ptr< testing::Screenshot > MakeScreenshot(const sk_sp< flutter::DisplayList > &list)
Scalar GetSecondsElapsed() const
RuntimeStage::Map OpenAssetAsRuntimeStage(const char *asset_name) const
bool OpenPlaygroundHere(Picture picture)
static bool ImGuiBegin(const char *name, bool *p_open, ImGuiWindowFlags flags)
std::function< sk_sp< flutter::DisplayList >()> AiksDlPlaygroundCallback
~GoldenPlaygroundTest() override
std::shared_ptr< Context > GetContext() const
void SetWindowSize(ISize size)
bool WillRenderSomething() const
Returns true if OpenPlaygroundHere will actually render anything.
std::shared_ptr< Texture > CreateTextureForFixture(const char *fixture_name, bool enable_mipmapping=false) const
std::map< RuntimeStageBackend, std::shared_ptr< RuntimeStage > > Map