This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ bool AiksPlayground::OpenPlaygroundHere(const Picture& picture) {
2222}
2323
2424bool AiksPlayground::OpenPlaygroundHere (AiksPlaygroundCallback callback) {
25- if (!Playground::is_enabled () ) {
25+ if (!switches_. enable_playground ) {
2626 return true ;
2727 }
2828
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ bool DisplayListPlayground::OpenPlaygroundHere(
2929
3030bool DisplayListPlayground::OpenPlaygroundHere (
3131 DisplayListPlaygroundCallback callback) {
32- if (!Playground::is_enabled () ) {
32+ if (!switches_. enable_playground ) {
3333 return true ;
3434 }
3535
Original file line number Diff line number Diff line change 9999 * Impeller is compiled into the Flutter engine. It is currently behind a flag
100100 as development progresses.
101101* How do you run ` impeller_unittests ` with Playgrounds enabled?
102- * Playgrounds in the ` impeller_unittests ` harness can be enabled in one of
103- three ways:
104- * Edit ` gn args ` directly and add ` impeller_enable_playground = true ` .
105- * Add the ` --enable-impeller-playground ` flag to your ` ./flutter/tools/gn `
106- invocation.
107- * Set the ` FLUTTER_IMPELLER_ENABLE_PLAYGROUND ` to ` 1 ` before invoking
108- ` ./flutter/tools/gn ` . Only do this if you frequently work with Playgrounds
109- and don't want to have to set the flags manually. Also, it would be a bad
110- idea to set this environment variable on CI.
102+ * Specify the ` --enable_playground ` command-line option.
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ EntityPlayground::EntityPlayground() = default;
1515EntityPlayground::~EntityPlayground () = default ;
1616
1717bool EntityPlayground::OpenPlaygroundHere (EntityPass& entity_pass) {
18- if (!Playground::is_enabled () ) {
18+ if (!switches_. enable_playground ) {
1919 return true ;
2020 }
2121
@@ -31,7 +31,7 @@ bool EntityPlayground::OpenPlaygroundHere(EntityPass& entity_pass) {
3131}
3232
3333bool EntityPlayground::OpenPlaygroundHere (Entity entity) {
34- if (!Playground::is_enabled () ) {
34+ if (!switches_. enable_playground ) {
3535 return true ;
3636 }
3737
@@ -46,7 +46,7 @@ bool EntityPlayground::OpenPlaygroundHere(Entity entity) {
4646}
4747
4848bool EntityPlayground::OpenPlaygroundHere (EntityPlaygroundCallback callback) {
49- if (!Playground::is_enabled () ) {
49+ if (!switches_. enable_playground ) {
5050 return true ;
5151 }
5252
Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ impeller_component("playground") {
5858 public_deps += [ " ../fixtures:shader_subgroup_fixtures" ]
5959 }
6060
61- public_configs = [ " :playground_config" ]
62-
6361 if (is_mac ) {
6462 frameworks = [
6563 " AppKit.framework" ,
@@ -83,9 +81,3 @@ impeller_component("playground_test") {
8381 " //flutter/testing" ,
8482 ]
8583}
86-
87- config (" playground_config" ) {
88- if (impeller_enable_playground ) {
89- defines = [ " IMPELLER_ENABLE_PLAYGROUND" ]
90- }
91- }
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ class AutoReleasePool {
202202
203203bool Playground::OpenPlaygroundHere (
204204 const Renderer::RenderCallback& render_callback) {
205- if (!is_enabled () ) {
205+ if (!switches_. enable_playground ) {
206206 return true ;
207207 }
208208
Original file line number Diff line number Diff line change @@ -38,8 +38,6 @@ class Playground {
3838
3939 virtual ~Playground ();
4040
41- static constexpr bool is_enabled () { return is_enabled_; }
42-
4341 static bool ShouldOpenNewPlaygrounds ();
4442
4543 void SetupContext (PlaygroundBackend backend);
@@ -98,15 +96,9 @@ class Playground {
9896 virtual bool ShouldKeepRendering () const ;
9997
10098 private:
101- #if IMPELLER_ENABLE_PLAYGROUND
102- static const bool is_enabled_ = true ;
103- #else
104- static const bool is_enabled_ = false ;
105- #endif // IMPELLER_ENABLE_PLAYGROUND
99+ struct GLFWInitializer ;
106100
107101 fml::TimeDelta start_time_;
108-
109- struct GLFWInitializer ;
110102 std::unique_ptr<GLFWInitializer> glfw_initializer_;
111103 std::unique_ptr<PlaygroundImpl> impl_;
112104 std::shared_ptr<Context> context_;
Original file line number Diff line number Diff line change @@ -11,9 +11,12 @@ namespace impeller {
1111PlaygroundSwitches::PlaygroundSwitches () = default ;
1212
1313PlaygroundSwitches::PlaygroundSwitches (const fml::CommandLine& args) {
14+ enable_playground = args.HasOption (" enable_playground" );
1415 std::string timeout_str;
1516 if (args.GetOptionValue (" playground_timeout_ms" , &timeout_str)) {
1617 timeout = std::chrono::milliseconds (atoi (timeout_str.c_str ()));
18+ // Specifying a playground timeout implies you want to enable playgrounds.
19+ enable_playground = true ;
1720 }
1821 enable_vulkan_validation = args.HasOption (" enable_vulkan_validation" );
1922}
Original file line number Diff line number Diff line change 1313namespace impeller {
1414
1515struct PlaygroundSwitches {
16+ bool enable_playground = false ;
1617 // If specified, the playgrounds will render for at least the duration
1718 // specified in the timeout. If the timeout is zero, exactly one frame will be
1819 // rendered in the playground.
Original file line number Diff line number Diff line change @@ -8,9 +8,6 @@ import("//flutter/impeller/tools/malioc.gni")
88import (" //flutter/testing/testing.gni" )
99
1010declare_args () {
11- # Whether playgrounds are enabled for unit tests.
12- impeller_enable_playground = false
13-
1411 # Whether the Metal backend is enabled.
1512 impeller_enable_metal = is_mac || is_ios
1613
You can’t perform that action at this time.
0 commit comments