Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f71baaa

Browse files
committed
moved check higher in the stack
1 parent d055b44 commit f71baaa

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

impeller/aiks/aiks_unittests.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -937,22 +937,8 @@ TEST_P(AiksTest, CanDrawPaintMultipleTimes) {
937937
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
938938
}
939939

940-
namespace {
941-
bool DoesSupportWideGamutTests() {
942-
#ifdef __arm64__
943-
return true;
944-
#else
945-
return false;
946-
#endif
947-
}
948-
} // namespace
949-
950940
// This makes sure the WideGamut named tests use 16bit float pixel format.
951941
TEST_P(AiksTest, FormatWideGamut) {
952-
if (!(GetParam() == PlaygroundBackend::kMetal &&
953-
DoesSupportWideGamutTests())) {
954-
GTEST_SKIP_("This backend doesn't yet support wide gamut.");
955-
}
956942
EXPECT_EQ(GetContext()->GetCapabilities()->GetDefaultColorFormat(),
957943
PixelFormat::kB10G10R10A10XR);
958944
EXPECT_TRUE(IsAlphaClampedToOne(
@@ -3118,11 +3104,6 @@ TEST_P(AiksTest, MipmapGenerationWorksCorrectly) {
31183104
}
31193105

31203106
TEST_P(AiksTest, DrawAtlasPlusWideGamut) {
3121-
if (!(GetParam() == PlaygroundBackend::kMetal &&
3122-
DoesSupportWideGamutTests())) {
3123-
GTEST_SKIP_("This backend doesn't yet support wide gamut.");
3124-
}
3125-
31263107
EXPECT_EQ(GetContext()->GetCapabilities()->GetDefaultColorFormat(),
31273108
PixelFormat::kB10G10R10A10XR);
31283109

impeller/playground/backend/metal/playground_impl_mtl.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
if (!window) {
7474
return;
7575
}
76+
7677
auto context = ContextMTL::Create(
7778
ShaderLibraryMappingsForPlayground(), is_gpu_disabled_sync_switch_,
7879
"Playground Library",

impeller/playground/playground_test.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ PlaygroundTest::PlaygroundTest()
1515

1616
PlaygroundTest::~PlaygroundTest() = default;
1717

18+
namespace {
19+
bool DoesSupportWideGamutTests() {
20+
#ifdef __arm64__
21+
return true;
22+
#else
23+
return false;
24+
#endif
25+
}
26+
} // namespace
27+
1828
void PlaygroundTest::SetUp() {
1929
if (!Playground::SupportsBackend(GetParam())) {
2030
GTEST_SKIP_("Playground doesn't support this backend type.");
@@ -34,6 +44,12 @@ void PlaygroundTest::SetUp() {
3444
switches.enable_wide_gamut =
3545
test_name.find("WideGamut/") != std::string::npos;
3646

47+
if (switches.enable_wide_gamut && (GetParam() != PlaygroundBackend::kMetal ||
48+
!DoesSupportWideGamutTests())) {
49+
GTEST_SKIP_("This backend doesn't yet support wide gamut.");
50+
return;
51+
}
52+
3753
SetupContext(GetParam(), switches);
3854
SetupWindow();
3955
}

0 commit comments

Comments
 (0)