Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
impeller::AiksPlayground Class Reference

#include <aiks_playground.h>

Inheritance diagram for impeller::AiksPlayground:
impeller::PlaygroundTest impeller::Playground

Public Types

using AiksPlaygroundCallback = std::function< std::optional< Picture >(AiksContext &renderer)>
 
using AiksDlPlaygroundCallback = std::function< sk_sp< flutter::DisplayList >()>
 
- Public Types inherited from impeller::Playground
using SinglePassCallback = std::function< bool(RenderPass &pass)>
 

Public Member Functions

 AiksPlayground ()
 
 ~AiksPlayground ()
 
void TearDown () override
 
void SetTypographerContext (std::shared_ptr< TypographerContext > typographer_context)
 
bool OpenPlaygroundHere (Picture picture)
 
bool OpenPlaygroundHere (AiksPlaygroundCallback callback)
 
bool OpenPlaygroundHere (const AiksDlPlaygroundCallback &callback)
 
bool OpenPlaygroundHere (const sk_sp< flutter::DisplayList > &list)
 
- Public Member Functions inherited from impeller::PlaygroundTest
 PlaygroundTest ()
 
virtual ~PlaygroundTest ()
 
void SetUp () override
 
void TearDown () override
 
PlaygroundBackend GetBackend () const
 
std::unique_ptr< fml::MappingOpenAssetAsMapping (std::string asset_name) const override
 
RuntimeStage::Map OpenAssetAsRuntimeStage (const char *asset_name) const
 
std::string GetWindowTitle () const override
 
- Public Member Functions inherited from impeller::Playground
 Playground (PlaygroundSwitches switches)
 
virtual ~Playground ()
 
void SetupContext (PlaygroundBackend backend, const PlaygroundSwitches &switches)
 
void SetupWindow ()
 
void TeardownWindow ()
 
bool IsPlaygroundEnabled () const
 
Point GetCursorPosition () const
 
ISize GetWindowSize () const
 
Point GetContentScale () const
 
Scalar GetSecondsElapsed () const
 Get the amount of time elapsed from the start of the playground's execution. More...
 
std::shared_ptr< ContextGetContext () const
 
std::shared_ptr< ContextMakeContext () const
 
bool OpenPlaygroundHere (const Renderer::RenderCallback &render_callback)
 
bool OpenPlaygroundHere (SinglePassCallback pass_callback)
 
std::shared_ptr< TextureCreateTextureForFixture (const char *fixture_name, bool enable_mipmapping=false) const
 
std::shared_ptr< TextureCreateTextureCubeForFixture (std::array< const char *, 6 > fixture_names) const
 
virtual std::unique_ptr< fml::MappingOpenAssetAsMapping (std::string asset_name) const =0
 
virtual std::string GetWindowTitle () const =0
 
fml::Status SetCapabilities (const std::shared_ptr< Capabilities > &capabilities)
 
bool WillRenderSomething () const
 

Static Public Member Functions

static bool ImGuiBegin (const char *name, bool *p_open, ImGuiWindowFlags flags)
 
- Static Public Member Functions inherited from impeller::Playground
static bool ShouldOpenNewPlaygrounds ()
 
static std::shared_ptr< CompressedImageLoadFixtureImageCompressed (std::shared_ptr< fml::Mapping > mapping)
 
static std::optional< DecompressedImageDecodeImageRGBA (const std::shared_ptr< CompressedImage > &compressed)
 
static std::shared_ptr< TextureCreateTextureForMapping (const std::shared_ptr< Context > &context, std::shared_ptr< fml::Mapping > mapping, bool enable_mipmapping=false)
 
static bool SupportsBackend (PlaygroundBackend backend)
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::Playground
virtual bool ShouldKeepRendering () const
 
void SetWindowSize (ISize size)
 
- Protected Attributes inherited from impeller::Playground
const PlaygroundSwitches switches_
 

Detailed Description

Definition at line 17 of file aiks_playground.h.

Member Typedef Documentation

◆ AiksDlPlaygroundCallback

Definition at line 22 of file aiks_playground.h.

◆ AiksPlaygroundCallback

Definition at line 19 of file aiks_playground.h.

Constructor & Destructor Documentation

◆ AiksPlayground()

impeller::AiksPlayground::AiksPlayground ( )

Definition at line 17 of file aiks_playground.cc.

18 : typographer_context_(TypographerContextSkia::Make()) {}
static std::shared_ptr< TypographerContext > Make()

◆ ~AiksPlayground()

impeller::AiksPlayground::~AiksPlayground ( )
default

Member Function Documentation

◆ ImGuiBegin()

bool impeller::AiksPlayground::ImGuiBegin ( const char *  name,
bool *  p_open,
ImGuiWindowFlags  flags 
)
static

Definition at line 69 of file aiks_playground.cc.

71 {
72 ImGui::Begin(name, p_open, flags);
73 return true;
74}
FlutterSemanticsFlag flags
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ OpenPlaygroundHere() [1/4]

bool impeller::AiksPlayground::OpenPlaygroundHere ( AiksPlaygroundCallback  callback)

Definition at line 48 of file aiks_playground.cc.

48 {
50 return true;
51 }
52
53 AiksContext renderer(GetContext(), typographer_context_);
54
55 if (!renderer.IsValid()) {
56 return false;
57 }
58
60 [&renderer, &callback](RenderTarget& render_target) -> bool {
61 std::optional<Picture> picture = callback(renderer);
62 if (!picture.has_value()) {
63 return false;
64 }
65 return renderer.Render(*picture, render_target, true);
66 });
67}
const PlaygroundSwitches switches_
Definition: playground.h:118
std::shared_ptr< Context > GetContext() const
Definition: playground.cc:90
bool OpenPlaygroundHere(const Renderer::RenderCallback &render_callback)
Definition: playground.cc:204
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)

◆ OpenPlaygroundHere() [2/4]

bool impeller::AiksPlayground::OpenPlaygroundHere ( const AiksDlPlaygroundCallback callback)

Definition at line 84 of file aiks_playground.cc.

85 {
86 AiksContext renderer(GetContext(), typographer_context_);
87
88 if (!renderer.IsValid()) {
89 return false;
90 }
91
93 [&renderer, &callback](RenderTarget& render_target) -> bool {
94 auto display_list = callback();
95 DlDispatcher dispatcher;
96 display_list->Dispatch(dispatcher);
97 Picture picture = dispatcher.EndRecordingAsPicture();
98
99 return renderer.Render(picture, render_target, true);
100 });
101}
SK_API sk_sp< PrecompileShader > Picture()

◆ OpenPlaygroundHere() [3/4]

bool impeller::AiksPlayground::OpenPlaygroundHere ( const sk_sp< flutter::DisplayList > &  list)

Definition at line 76 of file aiks_playground.cc.

77 {
78 DlDispatcher dispatcher;
79 list->Dispatch(dispatcher);
80 Picture picture = dispatcher.EndRecordingAsPicture();
81 return OpenPlaygroundHere(std::move(picture));
82}
void Dispatch(DlOpReceiver &ctx) const
bool OpenPlaygroundHere(Picture picture)

◆ OpenPlaygroundHere() [4/4]

bool impeller::AiksPlayground::OpenPlaygroundHere ( Picture  picture)

Definition at line 31 of file aiks_playground.cc.

31 {
33 return true;
34 }
35
36 AiksContext renderer(GetContext(), typographer_context_);
37
38 if (!renderer.IsValid()) {
39 return false;
40 }
41
43 [&renderer, &picture](RenderTarget& render_target) -> bool {
44 return renderer.Render(picture, render_target, true);
45 });
46}

◆ SetTypographerContext()

void impeller::AiksPlayground::SetTypographerContext ( std::shared_ptr< TypographerContext typographer_context)

Definition at line 22 of file aiks_playground.cc.

23 {
24 typographer_context_ = std::move(typographer_context);
25}

◆ TearDown()

void impeller::AiksPlayground::TearDown ( )
override

Definition at line 27 of file aiks_playground.cc.

27 {
29}

The documentation for this class was generated from the following files: