Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::AiksPlayground Class Reference

#include <aiks_playground.h>

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

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)>
 
using VKProcAddressResolver = std::function< void *(void *instance, 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)
 
bool IsGoldenTest ()
 
- 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
 
absl::StatusOr< RuntimeStage::MapOpenAssetAsRuntimeStage (const char *asset_name) const
 
std::string GetWindowTitle () const override
 
- Public Member Functions inherited from impeller::Playground
 Playground (PlaygroundBackend backend, const PlaygroundSwitches &switches)
 
virtual ~Playground ()
 
bool IsPlaygroundEnabled () const
 
Point GetCursorPosition () const
 
ISize GetWindowSize () const
 
IRect GetWindowBounds () 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
 
ContentContextGetContentContext () const
 
std::shared_ptr< TypographerContextGetTypographerContext () const
 
bool OpenPlaygroundHere (const 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
 Returns true if OpenPlaygroundHere will actually render anything.
 
GLProcAddressResolver CreateGLProcAddressResolver () const
 
VKProcAddressResolver CreateVKProcAddressResolver () const
 
void SetGPUDisabled (bool disabled) const
 Mark the GPU as unavilable.
 
RuntimeStageBackend GetRuntimeStageBackend () 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 TearDownContextData ()
 
virtual void EnsureContextIsUnique ()
 Make sure that when the context is later created that it will not be shared with any other playgrounds.
 
bool PlatformSupportsWideGamutTests () const
 Returns true if the platform can support wide gamuts.
 
virtual bool EnsureContextSupportsWideGamut ()
 Make sure that when the context is later created that it will support wide gamuts if the platform supports it. Returns whether the platform supports wide gamut.
 
virtual void EnsureContextSupportsAntialiasLines ()
 Make sure that when the context is later created that it will support the experimental AA lines flag.
 
const PlaygroundSwitchesGetSwitches () const
 Return an unmodifiable reference to the current switches. The switches might change at the start of a test as it has a brief opportunity to call any of the Ensure* methods that define the environment it expects, but should be stable by the time any subsequent methods that might perform work are called.
 
void SetTypographerContext (std::shared_ptr< TypographerContext > typographer_context)
 
void SetWindowSize (ISize size)
 

Detailed Description

Definition at line 16 of file aiks_playground.h.

Member Typedef Documentation

◆ AiksDlPlaygroundCallback

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()) {}
static std::shared_ptr< TypographerContext > Make()

◆ ~AiksPlayground()

impeller::AiksPlayground::~AiksPlayground ( )
default

Member Function Documentation

◆ ImGuiBegin()

◆ IsGoldenTest()

bool impeller::AiksPlayground::IsGoldenTest ( )
inline

Definition at line 37 of file aiks_playground.h.

37{ return false; }

◆ 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
51 [&renderer, &callback](RenderTarget& render_target) -> bool {
52 return RenderToTarget(
53 renderer.GetContentContext(), //
54 render_target, //
55 callback(), //
56 Rect::MakeWH(render_target.GetRenderTargetSize().width,
57 render_target.GetRenderTargetSize().height), //
58 /*reset_host_buffer=*/true, //
59 /*is_onscreen=*/false);
60 });
61}
bool OpenPlaygroundHere(const RenderCallback &render_callback)
std::shared_ptr< Context > GetContext() const
FlutterDesktopBinaryReply callback
bool RenderToTarget(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, Rect cull_rect, bool reset_host_buffer, bool is_onscreen)
Render the provided display list to the render target.
static constexpr TRect MakeWH(Type width, Type height)
Definition rect.h:140

References callback, impeller::AiksContext::GetContentContext(), impeller::Playground::GetContext(), impeller::RenderTarget::GetRenderTargetSize(), impeller::TSize< T >::height, impeller::AiksContext::IsValid(), impeller::TRect< Scalar >::MakeWH(), impeller::Playground::OpenPlaygroundHere(), impeller::RenderToTarget(), and impeller::TSize< T >::width.

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}
bool OpenPlaygroundHere(const AiksDlPlaygroundCallback &callback)

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 {
28}

References impeller::PlaygroundTest::TearDown().


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