5 #include "flutter/fml/time/time_point.h"
16 [](
const char* message,
const char* file,
int line) ->
bool {
22 [message, file, line]() ->
void {
23 GTEST_MESSAGE_AT_(file, line,
"Impeller Validation Error",
24 ::testing::TestPartResult::kFatalFailure)
36 bool DoesSupportWideGamutTests() {
47 GTEST_SKIP() <<
"Playground doesn't support this backend type.";
52 GTEST_SKIP() <<
"Skipping due to user action.";
57 std::string test_name = flutter::testing::GetCurrentTestName();
60 test_name.find(
"WideGamut/") != std::string::npos;
63 !DoesSupportWideGamutTests())) {
64 GTEST_SKIP() <<
"This backend doesn't yet support wide gamut.";
69 test_name.find(
"ExperimentAntialiasLines/") != std::string::npos;
85 std::string asset_name)
const {
86 return flutter::testing::OpenFixtureAsMapping(asset_name);
90 const char* asset_name)
const {
91 const std::shared_ptr<fml::Mapping> fixture =
92 flutter::testing::OpenFixtureAsMapping(asset_name);
93 if (!fixture || fixture->GetSize() == 0) {
101 std::stringstream stream;
102 stream <<
"Impeller Playground for '"
103 << flutter::testing::GetCurrentTestName() <<
"' ";
109 stream <<
" (Angle) ";
114 stream <<
" (SwiftShader) ";
118 stream <<
" (Press ESC to quit)";
123 bool PlaygroundTest::ShouldKeepRendering()
const {
static bool ShouldOpenNewPlaygrounds()
void SetupContext(PlaygroundBackend backend, const PlaygroundSwitches &switches)
const PlaygroundSwitches switches_
static bool SupportsBackend(PlaygroundBackend backend)
Scalar GetSecondsElapsed() const
Get the amount of time elapsed from the start of the playground's execution.
std::unique_ptr< fml::Mapping > OpenAssetAsMapping(std::string asset_name) const override
std::string GetWindowTitle() const override
PlaygroundBackend GetBackend() const
virtual ~PlaygroundTest()
RuntimeStage::Map OpenAssetAsRuntimeStage(const char *asset_name) const
std::map< RuntimeStageBackend, std::shared_ptr< RuntimeStage > > Map
static Map DecodeRuntimeStages(const std::shared_ptr< fml::Mapping > &payload)
void ImpellerValidationErrorsSetCallback(ValidationFailureCallback callback)
Sets a callback that callers (usually tests) can set to intercept validation failures.
std::chrono::duration< float > SecondsF
bool antialiased_lines
When turned on DrawLine will use the experimental antialiased path.
std::optional< std::chrono::milliseconds > timeout