5#ifndef FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_H_
6#define FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_H_
77 std::shared_ptr<fml::Mapping> mapping);
80 const std::shared_ptr<CompressedImage>& compressed);
83 const std::shared_ptr<Context>&
context,
84 std::shared_ptr<fml::Mapping> mapping,
85 bool enable_mipmapping =
false);
88 const char* fixture_name,
89 bool enable_mipmapping =
false)
const;
92 std::array<const char*, 6> fixture_names)
const;
97 std::string asset_name)
const = 0;
102 const std::shared_ptr<Capabilities>& capabilities);
111 std::function<
void*(
void*
instance,
const char* proc_name)>;
170 std::shared_ptr<TypographerContext> typographer_context);
189 mutable std::unique_ptr<PlaygroundImpl> impl_;
190 mutable std::shared_ptr<Context> context_;
191 mutable std::unique_ptr<ContentContext> content_context_;
192 mutable std::shared_ptr<TypographerContext> typographer_context_;
194 Point cursor_position_;
196 std::shared_ptr<HostBuffer> host_buffer_;
198 std::unique_ptr<PlaygroundImpl>& GetImpl()
const;
200 void SetupContext()
const;
204 void SetCursorPosition(
Point pos);
206 Playground(
const Playground&) =
delete;
208 Playground& operator=(
const Playground&) =
delete;
bool OpenPlaygroundHere(const RenderCallback &render_callback)
std::shared_ptr< Context > MakeContext() const
bool IsPlaygroundEnabled() const
virtual bool EnsureContextSupportsWideGamut()
Make sure that when the context is later created that it will support wide gamuts if the platform sup...
virtual bool ShouldKeepRendering() const
static bool ShouldOpenNewPlaygrounds()
bool PlatformSupportsWideGamutTests() const
Returns true if the platform can support wide gamuts.
Point GetCursorPosition() const
void SetWindowSize(ISize size)
static std::shared_ptr< CompressedImage > LoadFixtureImageCompressed(std::shared_ptr< fml::Mapping > mapping)
ISize GetWindowSize() const
std::function< bool(RenderPass &pass)> SinglePassCallback
GLProcAddressResolver CreateGLProcAddressResolver() const
bool WillRenderSomething() const
Returns true if OpenPlaygroundHere will actually render anything.
RuntimeStageBackend GetRuntimeStageBackend() const
void TearDownContextData()
virtual std::string GetWindowTitle() const =0
ContentContext & GetContentContext() const
std::function< bool(RenderTarget &render_target)> RenderCallback
void SetGPUDisabled(bool disabled) const
Mark the GPU as unavilable.
std::shared_ptr< TypographerContext > GetTypographerContext() const
std::shared_ptr< Context > GetContext() const
static bool SupportsBackend(PlaygroundBackend backend)
static std::shared_ptr< Texture > CreateTextureForMapping(const std::shared_ptr< Context > &context, std::shared_ptr< fml::Mapping > mapping, bool enable_mipmapping=false)
virtual void EnsureContextIsUnique()
Make sure that when the context is later created that it will not be shared with any other playground...
IRect GetWindowBounds() const
const PlaygroundSwitches & GetSwitches() const
Return an unmodifiable reference to the current switches. The switches might change at the start of a...
virtual std::unique_ptr< fml::Mapping > OpenAssetAsMapping(std::string asset_name) const =0
Point GetContentScale() const
std::shared_ptr< Texture > CreateTextureForFixture(const char *fixture_name, bool enable_mipmapping=false) const
Scalar GetSecondsElapsed() const
Get the amount of time elapsed from the start of the playground's execution.
virtual void EnsureContextSupportsAntialiasLines()
Make sure that when the context is later created that it will support the experimental AA lines flag.
std::function< void *(void *instance, const char *proc_name)> VKProcAddressResolver
std::function< void *(const char *proc_name)> GLProcAddressResolver
void SetTypographerContext(std::shared_ptr< TypographerContext > typographer_context)
static std::optional< DecompressedImage > DecodeImageRGBA(const std::shared_ptr< CompressedImage > &compressed)
std::shared_ptr< Texture > CreateTextureCubeForFixture(std::array< const char *, 6 > fixture_names) const
fml::Status SetCapabilities(const std::shared_ptr< Capabilities > &capabilities)
VKProcAddressResolver CreateVKProcAddressResolver() const
Render passes encode render commands directed as one specific render target into an underlying comman...
std::string PlaygroundBackendToString(PlaygroundBackend backend)
std::shared_ptr< ContextGLES > context