File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,29 @@ bool EntityPlayground::OpenPlaygroundHere(Entity entity) {
1717 return true ;
1818 }
1919
20- ContentContext context_context (GetContext ());
21- if (!context_context .IsValid ()) {
20+ ContentContext content_context (GetContext ());
21+ if (!content_context .IsValid ()) {
2222 return false ;
2323 }
2424 Renderer::RenderCallback callback = [&](RenderPass& pass) -> bool {
25- return entity.Render (context_context , pass);
25+ return entity.Render (content_context , pass);
2626 };
2727 return Playground::OpenPlaygroundHere (callback);
2828}
2929
30+ bool EntityPlayground::OpenPlaygroundHere (EntityPlaygroundCallback callback) {
31+ if (!Playground::is_enabled ()) {
32+ return true ;
33+ }
34+
35+ ContentContext content_context (GetContext ());
36+ if (!content_context.IsValid ()) {
37+ return false ;
38+ }
39+ Renderer::RenderCallback render_callback = [&](RenderPass& pass) -> bool {
40+ return callback (content_context, pass);
41+ };
42+ return Playground::OpenPlaygroundHere (render_callback);
43+ }
44+
3045} // namespace impeller
Original file line number Diff line number Diff line change 55#pragma once
66
77#include " flutter/fml/macros.h"
8+ #include " impeller/entity/content_context.h"
89#include " impeller/entity/entity.h"
910#include " impeller/playground/playground.h"
1011
1112namespace impeller {
1213
1314class EntityPlayground : public Playground {
1415 public:
16+ using EntityPlaygroundCallback =
17+ std::function<bool (ContentContext& context, RenderPass& pass)>;
18+
1519 EntityPlayground ();
1620
1721 ~EntityPlayground ();
1822
1923 bool OpenPlaygroundHere (Entity entity);
2024
25+ bool OpenPlaygroundHere (EntityPlaygroundCallback callback);
26+
2127 private:
2228 FML_DISALLOW_COPY_AND_ASSIGN (EntityPlayground);
2329};
You can’t perform that action at this time.
0 commit comments