We have 2 (soon 3) cases where playground tests have special needs when the playground test context is created. Currently, due to the fact that the PlaygroundImpl and its Context are already created before the test body is run, the tests cannot express these needs programmatically. Looking at the name of the test to assign specific features for the context is a pretty fragile work-around. See
|
// Test names that end with "WideGamut" will render with wide gamut support. |
|
switches.flags.antialiased_lines = |
- (a new requirement in the shared OpenGL context work that would support a test that wanted to opt out of the shared context)
Instead, the PlaygroundImpl and its Context could be lazily created only when they are first needed. This would give the test body time to call methods at the top of their test body to express their need for wide gamut, AA lines flag, and opt out of shared contexts.
We have 2 (soon 3) cases where playground tests have special needs when the playground test context is created. Currently, due to the fact that the
PlaygroundImpland itsContextare already created before the test body is run, the tests cannot express these needs programmatically. Looking at the name of the test to assign specific features for the context is a pretty fragile work-around. Seeflutter/engine/src/flutter/impeller/playground/playground_test.cc
Line 56 in b7d5550
flutter/engine/src/flutter/impeller/playground/playground_test.cc
Line 68 in b7d5550
Instead, the
PlaygroundImpland itsContextcould be lazily created only when they are first needed. This would give the test body time to call methods at the top of their test body to express their need for wide gamut, AA lines flag, and opt out of shared contexts.