22 "impeller_Play_AiksTest_CanDrawPaintMultipleTimesInteractive_Metal",
23 "impeller_Play_AiksTest_CanDrawPaintMultipleTimesInteractive_Vulkan",
24 "impeller_Play_AiksTest_CanRenderLinearGradientManyColorsUnevenStops_Metal",
25 "impeller_Play_AiksTest_CanRenderLinearGradientManyColorsUnevenStops_"
27 "impeller_Play_AiksTest_CanRenderRadialGradient_Metal",
28 "impeller_Play_AiksTest_CanRenderRadialGradient_Vulkan",
29 "impeller_Play_AiksTest_CanRenderRadialGradientManyColors_Metal",
30 "impeller_Play_AiksTest_CanRenderRadialGradientManyColors_Vulkan",
31 "impeller_Play_AiksTest_CanRenderBackdropBlurInteractive_Metal",
32 "impeller_Play_AiksTest_CanRenderBackdropBlurInteractive_Vulkan",
33 "impeller_Play_AiksTest_ClippedBlurFilterRendersCorrectlyInteractive_Metal",
34 "impeller_Play_AiksTest_ClippedBlurFilterRendersCorrectlyInteractive_"
36 "impeller_Play_AiksTest_TextFrameSubpixelAlignment_Metal",
37 "impeller_Play_AiksTest_TextFrameSubpixelAlignment_Vulkan",
38 "impeller_Play_AiksTest_ColorWheel_Metal",
39 "impeller_Play_AiksTest_ColorWheel_Vulkan",
40 "impeller_Play_AiksTest_SolidStrokesRenderCorrectly_Metal",
41 "impeller_Play_AiksTest_SolidStrokesRenderCorrectly_Vulkan",
42 "impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Metal",
43 "impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Vulkan",
44 "impeller_Play_AiksTest_CoverageOriginShouldBeAccountedForInSubpasses_"
46 "impeller_Play_AiksTest_CoverageOriginShouldBeAccountedForInSubpasses_"
48 "impeller_Play_AiksTest_SceneColorSource_Metal",
49 "impeller_Play_AiksTest_SceneColorSource_Vulkan",
52 "impeller_Play_AiksTest_TextRotated_Metal",
53 "impeller_Play_AiksTest_TextRotated_Vulkan",
57 std::string GetTestName() {
58 std::string suite_name =
59 ::testing::UnitTest::GetInstance()->current_test_suite()->name();
60 std::string test_name =
61 ::testing::UnitTest::GetInstance()->current_test_info()->name();
63 ss <<
"impeller_" << suite_name <<
"_" << test_name;
64 std::string result = ss.str();
66 std::replace(result.begin(), result.end(),
'/',
'_');
70 std::string GetGoldenFilename() {
71 return GetTestName() +
".png";
74 bool SaveScreenshot(std::unique_ptr<testing::MetalScreenshot> screenshot) {
75 if (!screenshot || !screenshot->GetBytes()) {
78 std::string test_name = GetTestName();
79 std::string filename = GetGoldenFilename();
81 test_name, filename, screenshot->GetWidth(), screenshot->GetHeight());
82 return screenshot->WriteToPNG(
100 std::shared_ptr<TypographerContext> typographer_context) {
101 typographer_context_ = std::move(typographer_context);
105 ASSERT_FALSE(dlopen(
"/usr/local/lib/libMoltenVK.dylib", RTLD_NOLOAD));
109 std::filesystem::path testing_assets_path =
110 flutter::testing::GetTestingAssetsPath();
111 std::filesystem::path target_path = testing_assets_path.parent_path()
115 std::filesystem::path icd_path = target_path /
"vk_swiftshader_icd.json";
116 setenv(
"VK_ICD_FILENAMES", icd_path.c_str(), 1);
120 GTEST_SKIP_(
"GoldenPlaygroundTest doesn't support this backend type.");
124 std::string test_name = GetTestName();
128 "GoldenPlaygroundTest doesn't support interactive playground tests "
133 "gpu_string",
GetContext()->DescribeGpuModel());
143 auto screenshot = pimpl_->screenshoter->MakeScreenshot(renderer, picture,
144 pimpl_->window_size);
145 return SaveScreenshot(std::move(screenshot));
155 const char* fixture_name,
156 bool enable_mipmapping)
const {
157 std::shared_ptr<fml::Mapping> mapping =
158 flutter::testing::OpenFixtureAsMapping(fixture_name);
162 result->SetLabel(fixture_name);
168 const char* asset_name)
const {
169 auto fixture = flutter::testing::OpenFixtureAsMapping(asset_name);
170 if (!fixture || fixture->GetSize() == 0) {
173 auto stage = std::make_unique<RuntimeStage>(std::move(fixture));
174 if (!stage->IsValid()) {
181 return pimpl_->screenshoter->GetPlayground().GetContext();
185 return pimpl_->screenshoter->GetPlayground().GetContentScale();
193 return pimpl_->window_size;