| Flutter Impeller |

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:

## Public Types
using | AiksDlPlaygroundCallback = std::function< sk_sp< flutter::DisplayList >()>
Public Types inherited from impeller::Playground
using | SinglePassCallback = std::function< bool(RenderPass &pass)>
using | RenderCallback = std::function< bool(RenderTarget &render_target)>
using | GLProcAddressResolver = std::function< void *(const char *proc_name)>

## Public Member Functions
| AiksPlayground ()
| ~AiksPlayground ()
void | TearDown () override
void | SetTypographerContext (std::shared_ptr< TypographerContext > typographer_context)
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::Mapping > | OpenAssetAsMapping (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< Context > | GetContext () const
std::shared_ptr< Context > | MakeContext () const
bool | OpenPlaygroundHere (const RenderCallback &render_callback)
bool | OpenPlaygroundHere (SinglePassCallback pass_callback)
std::shared_ptr< Texture > | CreateTextureForFixture (const char *fixture_name, bool enable_mipmapping=false) const
std::shared_ptr< Texture > | CreateTextureCubeForFixture (std::array< const char *, 6 > fixture_names) const
fml::Status | SetCapabilities (const std::shared_ptr< Capabilities > &capabilities)
bool | WillRenderSomething () const
| Returns true if `OpenPlaygroundHere` will actually render anything. More...
GLProcAddressResolver | CreateGLProcAddressResolver () 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< CompressedImage > | LoadFixtureImageCompressed (std::shared_ptr< fml::Mapping > mapping)
static std::optional< DecompressedImage > | DecodeImageRGBA (const std::shared_ptr< CompressedImage > &compressed)
static std::shared_ptr< Texture > | CreateTextureForMapping (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 16 of file aiks_playground.h.

## Member Typedef Documentation

## ◆ AiksDlPlaygroundCallback

using impeller::AiksPlayground::AiksDlPlaygroundCallback = std::function<sk_sp<flutter::DisplayList>()>

Definition at line 18 of file aiks_playground.h.

## Constructor & Destructor Documentation

## ◆ AiksPlayground()

impeller::AiksPlayground::AiksPlayground | ( |  | ) |

Definition at line 16 of file aiks_playground.cc.

17 : typographer_context_(TypographerContextSkia::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 30 of file aiks_playground.cc.

32 {
33 ImGui::Begin(name, p_open, flags);
34 return true;
35 }

Referenced by impeller::testing::BlendModeTest(), and impeller::testing::TEST_P().

## ◆ OpenPlaygroundHere() [1/2]

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

Definition at line 42 of file aiks_playground.cc.

43 {
44 AiksContext renderer(GetContext(), typographer_context_);
45
46 if (!renderer.IsValid()) {
47 return false;
48 }
49
50 return Playground::OpenPlaygroundHere(
51 [&renderer, &callback](RenderTarget& render_target) -> bool {
52 auto display_list = callback();
53 TextFrameDispatcher collector(renderer.GetContentContext(), //
54 Matrix(), //
55 Rect::MakeMaximum() //
56 );
57 display_list->Dispatch(collector);
58
59 CanvasDlDispatcher impeller_dispatcher(
60 renderer.GetContentContext(), render_target,
61 display_list->root_has_backdrop_filter(),
62 display_list->max_root_blend_mode(), IRect::MakeMaximum());
63 display_list->Dispatch(impeller_dispatcher);
64 impeller_dispatcher.FinishRecording();
65 renderer.GetContentContext().GetTransientsBuffer().Reset();
66 renderer.GetContentContext().GetLazyGlyphAtlas()->ResetTextFrames();
67 return true;
68 });
69 }

References impeller::CanvasDlDispatcher::FinishRecording(), impeller::AiksContext::GetContentContext(), impeller::Playground::GetContext(), impeller::ContentContext::GetLazyGlyphAtlas(), impeller::ContentContext::GetTransientsBuffer(), impeller::AiksContext::IsValid(), impeller::TRect< T >::MakeMaximum(), impeller::TRect< Scalar >::MakeMaximum(), impeller::Playground::OpenPlaygroundHere(), and impeller::HostBuffer::Reset().

Referenced by impeller::testing::CanRenderConicalGradientWithDithering(), impeller::testing::CanRenderLinearGradientWithDithering(), impeller::testing::CanRenderRadialGradientWithDithering(), impeller::testing::CanRenderSweepGradientWithDithering(), and OpenPlaygroundHere().

## ◆ OpenPlaygroundHere() [2/2]

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

Definition at line 37 of file aiks_playground.cc.

38 {
39 return OpenPlaygroundHere([list]() { return list; });
40 }

References OpenPlaygroundHere().

## ◆ SetTypographerContext()

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

Definition at line 21 of file aiks_playground.cc.

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

## ◆ TearDown()

void impeller::AiksPlayground::TearDown | ( |  | ) |
| override

Definition at line 26 of file aiks_playground.cc.

26 {
27 PlaygroundTest::TearDown();
28 }

References impeller::PlaygroundTest::TearDown().

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

- impeller/display_list/aiks_playground.h
- impeller/display_list/aiks_playground.cc

impeller::AiksPlayground::OpenPlaygroundHere
bool OpenPlaygroundHere(const AiksDlPlaygroundCallback &callback)
Definition: aiks_playground.cc:42
impeller::Playground::OpenPlaygroundHere
bool OpenPlaygroundHere(const RenderCallback &render_callback)
Definition: playground.cc:197
impeller::PlaygroundTest::TearDown
void TearDown() override
Definition: playground_test.cc:76
impeller::TRect< Scalar >::MakeMaximum
constexpr static TRect MakeMaximum()
Definition: rect.h:178
impeller::Playground::GetContext
std::shared_ptr< Context > GetContext() const
Definition: playground.cc:90
impeller::TypographerContextSkia::Make
static std::shared_ptr< TypographerContext > Make()
Definition: typographer_context_skia.cc:75