Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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)>
 
- 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)
 
- 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.
 
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
 
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
void SetWindowSize (ISize size)
 
- Protected Attributes inherited from impeller::Playground
const PlaygroundSwitches switches_
 

Detailed Description

Definition at line 18 of file aiks_playground.h.

Member Typedef Documentation

◆ AiksPlaygroundCallback

using impeller::AiksPlayground::AiksPlaygroundCallback = std::function<std::optional<Picture>(AiksContext& renderer)>

Definition at line 20 of file aiks_playground.h.

Constructor & Destructor Documentation

◆ AiksPlayground()

impeller::AiksPlayground::AiksPlayground ( )

Definition at line 15 of file aiks_playground.cc.

16 : 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 59 of file aiks_playground.cc.

61 {
62 ImGui::Begin(name, p_open, flags);
63 return true;
64}
FlutterSemanticsFlag flags
const char * name
Definition fuchsia.cc:50

◆ OpenPlaygroundHere() [1/2]

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

Definition at line 36 of file aiks_playground.cc.

36 {
38 return true;
39 }
40
41 AiksContext renderer(GetContext(), typographer_context_);
42
43 if (!renderer.IsValid()) {
44 return false;
45 }
46
48 [this, &renderer, &callback](RenderTarget& render_target) -> bool {
49 const std::optional<Picture>& picture = inspector_.RenderInspector(
50 renderer, [&]() { return callback(renderer); });
51
52 if (!picture.has_value()) {
53 return false;
54 }
55 return renderer.Render(*picture, render_target, true);
56 });
57}
const std::optional< Picture > & RenderInspector(AiksContext &aiks_context, const std::function< std::optional< Picture >()> &picture_callback)
const PlaygroundSwitches switches_
Definition playground.h:120
std::shared_ptr< Context > GetContext() const
Definition playground.cc:89
bool OpenPlaygroundHere(const Renderer::RenderCallback &render_callback)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
sk_sp< const SkPicture > picture
Definition SkRecords.h:299

◆ OpenPlaygroundHere() [2/2]

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

Definition at line 30 of file aiks_playground.cc.

30 {
31 return OpenPlaygroundHere([&picture](AiksContext& renderer) -> Picture {
32 return std::move(picture);
33 });
34}
bool OpenPlaygroundHere(Picture picture)

◆ SetTypographerContext()

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

Definition at line 20 of file aiks_playground.cc.

21 {
22 typographer_context_ = std::move(typographer_context);
23}

◆ TearDown()

void impeller::AiksPlayground::TearDown ( )
override

Definition at line 25 of file aiks_playground.cc.


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