File tree 2 files changed +24
-3
lines changed
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) {
17
17
return true ;
18
18
}
19
19
20
- ContentContext context_context (GetContext ());
21
- if (!context_context .IsValid ()) {
20
+ ContentContext content_context (GetContext ());
21
+ if (!content_context .IsValid ()) {
22
22
return false ;
23
23
}
24
24
Renderer::RenderCallback callback = [&](RenderPass& pass) -> bool {
25
- return entity.Render (context_context , pass);
25
+ return entity.Render (content_context , pass);
26
26
};
27
27
return Playground::OpenPlaygroundHere (callback);
28
28
}
29
29
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
+
30
45
} // namespace impeller
Original file line number Diff line number Diff line change 5
5
#pragma once
6
6
7
7
#include " flutter/fml/macros.h"
8
+ #include " impeller/entity/content_context.h"
8
9
#include " impeller/entity/entity.h"
9
10
#include " impeller/playground/playground.h"
10
11
11
12
namespace impeller {
12
13
13
14
class EntityPlayground : public Playground {
14
15
public:
16
+ using EntityPlaygroundCallback =
17
+ std::function<bool (ContentContext& context, RenderPass& pass)>;
18
+
15
19
EntityPlayground ();
16
20
17
21
~EntityPlayground ();
18
22
19
23
bool OpenPlaygroundHere (Entity entity);
20
24
25
+ bool OpenPlaygroundHere (EntityPlaygroundCallback callback);
26
+
21
27
private:
22
28
FML_DISALLOW_COPY_AND_ASSIGN (EntityPlayground);
23
29
};
You can’t perform that action at this time.
0 commit comments