22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5+ #include < dlfcn.h>
6+ #include < filesystem>
7+
58#include " flutter/impeller/golden_tests/golden_playground_test.h"
69
710#include " flutter/impeller/aiks/picture.h"
@@ -14,18 +17,30 @@ namespace impeller {
1417// to also be a golden test, then add the test name here.
1518static const std::vector<std::string> kSkipTests = {
1619 " impeller_Play_AiksTest_CanRenderLinearGradientManyColorsUnevenStops_Metal" ,
20+ " impeller_Play_AiksTest_CanRenderLinearGradientManyColorsUnevenStops_"
21+ " Vulkan" ,
1722 " impeller_Play_AiksTest_CanRenderRadialGradient_Metal" ,
23+ " impeller_Play_AiksTest_CanRenderRadialGradient_Vulkan" ,
1824 " impeller_Play_AiksTest_CanRenderRadialGradientManyColors_Metal" ,
25+ " impeller_Play_AiksTest_CanRenderRadialGradientManyColors_Vulkan" ,
1926 " impeller_Play_AiksTest_TextFrameSubpixelAlignment_Metal" ,
27+ " impeller_Play_AiksTest_TextFrameSubpixelAlignment_Vulkan" ,
2028 " impeller_Play_AiksTest_ColorWheel_Metal" ,
29+ " impeller_Play_AiksTest_ColorWheel_Vulkan" ,
2130 " impeller_Play_AiksTest_SolidStrokesRenderCorrectly_Metal" ,
31+ " impeller_Play_AiksTest_SolidStrokesRenderCorrectly_Vulkan" ,
2232 " impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Metal" ,
33+ " impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Vulkan" ,
2334 " impeller_Play_AiksTest_CoverageOriginShouldBeAccountedForInSubpasses_"
2435 " Metal" ,
36+ " impeller_Play_AiksTest_CoverageOriginShouldBeAccountedForInSubpasses_"
37+ " Vulkan" ,
2538 " impeller_Play_AiksTest_SceneColorSource_Metal" ,
39+ " impeller_Play_AiksTest_SceneColorSource_Vulkan" ,
2640 // TextRotated is flakey and we can't seem to get it to stabilize on Skia
2741 // Gold.
2842 " impeller_Play_AiksTest_TextRotated_Metal" ,
43+ " impeller_Play_AiksTest_TextRotated_Vulkan" ,
2944};
3045
3146namespace {
@@ -68,8 +83,22 @@ struct GoldenPlaygroundTest::GoldenPlaygroundTestImpl {
6883GoldenPlaygroundTest::GoldenPlaygroundTest ()
6984 : pimpl_(new GoldenPlaygroundTest::GoldenPlaygroundTestImpl()) {}
7085
86+ void GoldenPlaygroundTest::TearDown () {
87+ ASSERT_FALSE (dlopen (" /usr/local/lib/libMoltenVK.dylib" , RTLD_NOLOAD));
88+ }
89+
7190void GoldenPlaygroundTest::SetUp () {
72- if (GetBackend () != PlaygroundBackend::kMetal ) {
91+ std::filesystem::path testing_assets_path =
92+ flutter::testing::GetTestingAssetsPath ();
93+ std::filesystem::path target_path = testing_assets_path.parent_path ()
94+ .parent_path ()
95+ .parent_path ()
96+ .parent_path ();
97+ std::filesystem::path icd_path = target_path / " vk_swiftshader_icd.json" ;
98+ setenv (" VK_ICD_FILENAMES" , icd_path.c_str (), 1 );
99+
100+ if (GetBackend () != PlaygroundBackend::kMetal &&
101+ GetBackend () != PlaygroundBackend::kVulkan ) {
73102 GTEST_SKIP_ (" GoldenPlaygroundTest doesn't support this backend type." );
74103 return ;
75104 }
0 commit comments