@@ -55,47 +55,33 @@ const std::unique_ptr<PlaygroundImpl>& GetSharedVulkanPlayground(
5555}
5656} // namespace
5757
58+ #define IMP_AIKSTEST (name ) \
59+ " impeller_Play_AiksTest_" #name " _Metal" , \
60+ " impeller_Play_AiksTest_" #name " _OpenGLES" , \
61+ " impeller_Play_AiksTest_" #name " _Vulkan"
62+
5863// If you add a new playground test to the aiks unittests and you do not want it
5964// to also be a golden test, then add the test name here.
6065static const std::vector<std::string> kSkipTests = {
61- " impeller_Play_AiksTest_CanDrawPaintMultipleTimesInteractive_Metal" ,
62- " impeller_Play_AiksTest_CanDrawPaintMultipleTimesInteractive_Vulkan" ,
63- " impeller_Play_AiksTest_CanRenderLinearGradientManyColorsUnevenStops_Metal" ,
64- " impeller_Play_AiksTest_CanRenderLinearGradientManyColorsUnevenStops_"
65- " Vulkan" ,
66- " impeller_Play_AiksTest_CanRenderRadialGradient_Metal" ,
67- " impeller_Play_AiksTest_CanRenderRadialGradient_Vulkan" ,
68- " impeller_Play_AiksTest_CanRenderRadialGradientManyColors_Metal" ,
69- " impeller_Play_AiksTest_CanRenderRadialGradientManyColors_Vulkan" ,
70- " impeller_Play_AiksTest_CanRenderBackdropBlurInteractive_Metal" ,
71- " impeller_Play_AiksTest_CanRenderBackdropBlurInteractive_Vulkan" ,
72- " impeller_Play_AiksTest_ClippedBlurFilterRendersCorrectlyInteractive_Metal" ,
73- " impeller_Play_AiksTest_ClippedBlurFilterRendersCorrectlyInteractive_"
74- " Vulkan" ,
75- " impeller_Play_AiksTest_CoverageOriginShouldBeAccountedForInSubpasses_"
76- " Metal" ,
77- " impeller_Play_AiksTest_CoverageOriginShouldBeAccountedForInSubpasses_"
78- " Vulkan" ,
79- " impeller_Play_AiksTest_GaussianBlurRotatedAndClippedInteractive_Metal" ,
80- " impeller_Play_AiksTest_GaussianBlurRotatedAndClippedInteractive_Vulkan" ,
81- " impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Metal" ,
82- " impeller_Play_AiksTest_GradientStrokesRenderCorrectly_Vulkan" ,
83- " impeller_Play_AiksTest_ColorWheel_Metal" ,
84- " impeller_Play_AiksTest_ColorWheel_Vulkan" ,
85- " impeller_Play_AiksTest_SceneColorSource_Metal" ,
86- " impeller_Play_AiksTest_SceneColorSource_Vulkan" ,
87- " impeller_Play_AiksTest_SolidStrokesRenderCorrectly_Metal" ,
88- " impeller_Play_AiksTest_SolidStrokesRenderCorrectly_Vulkan" ,
89- " impeller_Play_AiksTest_TextFrameSubpixelAlignment_Metal" ,
90- " impeller_Play_AiksTest_TextFrameSubpixelAlignment_Vulkan" ,
66+ IMP_AIKSTEST (CanDrawPaintMultipleTimesInteractive),
67+ IMP_AIKSTEST (CanRenderLinearGradientManyColorsUnevenStops),
68+ IMP_AIKSTEST (CanRenderRadialGradient),
69+ IMP_AIKSTEST (CanRenderRadialGradientManyColors),
70+ IMP_AIKSTEST (CanRenderBackdropBlurInteractive),
71+ IMP_AIKSTEST (ClippedBlurFilterRendersCorrectlyInteractive),
72+ IMP_AIKSTEST (CoverageOriginShouldBeAccountedForInSubpasses),
73+ IMP_AIKSTEST (GaussianBlurRotatedAndClippedInteractive),
74+ IMP_AIKSTEST (GradientStrokesRenderCorrectly),
75+ IMP_AIKSTEST (ColorWheel),
76+ IMP_AIKSTEST (SceneColorSource),
77+ IMP_AIKSTEST (SolidStrokesRenderCorrectly),
78+ IMP_AIKSTEST (TextFrameSubpixelAlignment),
9179 // TextRotated is flakey and we can't seem to get it to stabilize on Skia
9280 // Gold.
93- " impeller_Play_AiksTest_TextRotated_Metal" ,
94- " impeller_Play_AiksTest_TextRotated_Vulkan" ,
81+ IMP_AIKSTEST (TextRotated),
9582 // Runtime stage based tests get confused with a Metal context.
9683 " impeller_Play_AiksTest_CanRenderClippedRuntimeEffects_Vulkan" ,
97- " impeller_Play_AiksTest_CaptureContext_Metal" ,
98- " impeller_Play_AiksTest_CaptureContext_Vulkan" ,
84+ IMP_AIKSTEST (CaptureContext),
9985};
10086
10187static const std::vector<std::string> kVulkanDenyValidationTests = {
@@ -143,6 +129,7 @@ bool ShouldTestHaveVulkanValidations() {
143129
144130struct GoldenPlaygroundTest ::GoldenPlaygroundTestImpl {
145131 std::unique_ptr<PlaygroundImpl> test_vulkan_playground;
132+ std::unique_ptr<PlaygroundImpl> test_opengl_playground;
146133 std::unique_ptr<testing::Screenshotter> screenshotter;
147134 ISize window_size = ISize{1024 , 768 };
148135};
@@ -172,13 +159,29 @@ void GoldenPlaygroundTest::SetUp() {
172159 std::filesystem::path icd_path = target_path / " vk_swiftshader_icd.json" ;
173160 setenv (" VK_ICD_FILENAMES" , icd_path.c_str (), 1 );
174161
175- if (GetBackend () != PlaygroundBackend::kMetal &&
176- GetBackend () != PlaygroundBackend::kVulkan ) {
177- GTEST_SKIP_ (" GoldenPlaygroundTest doesn't support this backend type." );
178- return ;
179- }
180-
181162 bool enable_vulkan_validations = ShouldTestHaveVulkanValidations ();
163+ switch (GetParam ()) {
164+ case PlaygroundBackend::kMetal :
165+ pimpl_->screenshotter = std::make_unique<testing::MetalScreenshotter>();
166+ break ;
167+ case PlaygroundBackend::kVulkan : {
168+ const std::unique_ptr<PlaygroundImpl>& playground =
169+ GetSharedVulkanPlayground (enable_vulkan_validations);
170+ pimpl_->screenshotter =
171+ std::make_unique<testing::VulkanScreenshotter>(playground);
172+ break ;
173+ }
174+ case PlaygroundBackend::kOpenGLES : {
175+ FML_CHECK (::glfwInit () == GLFW_TRUE);
176+ PlaygroundSwitches playground_switches;
177+ playground_switches.use_angle = true ;
178+ pimpl_->test_opengl_playground = PlaygroundImpl::Create (
179+ PlaygroundBackend::kOpenGLES , playground_switches);
180+ pimpl_->screenshotter = std::make_unique<testing::VulkanScreenshotter>(
181+ pimpl_->test_opengl_playground );
182+ break ;
183+ }
184+ }
182185 if (GetParam () == PlaygroundBackend::kMetal ) {
183186 pimpl_->screenshotter = std::make_unique<testing::MetalScreenshotter>();
184187 } else if (GetParam () == PlaygroundBackend::kVulkan ) {
@@ -272,8 +275,8 @@ std::shared_ptr<Context> GoldenPlaygroundTest::MakeContext() const {
272275 pimpl_->test_vulkan_playground );
273276 return pimpl_->test_vulkan_playground ->GetContext ();
274277 } else {
275- FML_CHECK ( false );
276- return nullptr ;
278+ // / On OpenGL we create a context for each test.
279+ return GetContext () ;
277280 }
278281}
279282
0 commit comments