From 9d32cac3edabdacc90d5e77c239c4068d05b615e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 6 Feb 2024 09:33:45 -0800 Subject: [PATCH] [Impeller] Specify if Angle or SwiftShader is being used in the title. (flutter/engine#50376) Minor QOL improvement. Tried taking a frame capture unsuccessfully before realizing that I was using SwiftShader. --- .../impeller/playground/playground_test.cc | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/engine/src/flutter/impeller/playground/playground_test.cc b/engine/src/flutter/impeller/playground/playground_test.cc index d9439dacc2..676c3b0412 100644 --- a/engine/src/flutter/impeller/playground/playground_test.cc +++ b/engine/src/flutter/impeller/playground/playground_test.cc @@ -56,15 +56,27 @@ RuntimeStage::Map PlaygroundTest::OpenAssetAsRuntimeStage( return RuntimeStage::DecodeRuntimeStages(fixture); } -static std::string FormatWindowTitle(const std::string& test_name) { - std::stringstream stream; - stream << "Impeller Playground for '" << test_name << "' (Press ESC to quit)"; - return stream.str(); -} - // |Playground| std::string PlaygroundTest::GetWindowTitle() const { - return FormatWindowTitle(flutter::testing::GetCurrentTestName()); + std::stringstream stream; + stream << "Impeller Playground for '" + << flutter::testing::GetCurrentTestName() << "' "; + switch (GetBackend()) { + case PlaygroundBackend::kMetal: + break; + case PlaygroundBackend::kOpenGLES: + if (switches_.use_angle) { + stream << " (Angle) "; + } + break; + case PlaygroundBackend::kVulkan: + if (switches_.use_swiftshader) { + stream << " (SwiftShader) "; + } + break; + } + stream << " (Press ESC to quit)"; + return stream.str(); } // |Playground|