From 81277b90ed64e19bf5574e80f878aac672a032e5 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 22 Jan 2024 14:19:18 -0800 Subject: [PATCH] [Impeller] Create the golden test screenshotter after setting the Vulkan ICD environment variable (flutter/engine#49948) This ensures that the test process will load the SwiftShader implementation of Vulkan if a VulkanScreenshotter is instantiated. --- .../golden_tests/golden_playground_test_mac.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engine/src/flutter/impeller/golden_tests/golden_playground_test_mac.cc b/engine/src/flutter/impeller/golden_tests/golden_playground_test_mac.cc index 996e144a98c..a465a33e762 100644 --- a/engine/src/flutter/impeller/golden_tests/golden_playground_test_mac.cc +++ b/engine/src/flutter/impeller/golden_tests/golden_playground_test_mac.cc @@ -98,13 +98,7 @@ struct GoldenPlaygroundTest::GoldenPlaygroundTestImpl { GoldenPlaygroundTest::GoldenPlaygroundTest() : typographer_context_(TypographerContextSkia::Make()), - pimpl_(new GoldenPlaygroundTest::GoldenPlaygroundTestImpl()) { - if (GetParam() == PlaygroundBackend::kMetal) { - pimpl_->screenshotter = std::make_unique(); - } else if (GetParam() == PlaygroundBackend::kVulkan) { - pimpl_->screenshotter = std::make_unique(); - } -} + pimpl_(new GoldenPlaygroundTest::GoldenPlaygroundTestImpl()) {} GoldenPlaygroundTest::~GoldenPlaygroundTest() = default; @@ -133,6 +127,12 @@ void GoldenPlaygroundTest::SetUp() { return; } + if (GetParam() == PlaygroundBackend::kMetal) { + pimpl_->screenshotter = std::make_unique(); + } else if (GetParam() == PlaygroundBackend::kVulkan) { + pimpl_->screenshotter = std::make_unique(); + } + std::string test_name = GetTestName(); if (std::find(kSkipTests.begin(), kSkipTests.end(), test_name) != kSkipTests.end()) {