Flutter Impeller
impeller::Playground Class Referenceabstract

#include <playground.h>

Inheritance diagram for impeller::Playground:
impeller::ComputePlaygroundTest impeller::PlaygroundTest impeller::AiksPlayground impeller::DlPlayground impeller::EntityPlayground impeller::interop::testing::PlaygroundTest impeller::RuntimeStagePlayground impeller::testing::RendererDartTest impeller::testing::BlendFilterContentsTest impeller::testing::GaussianBlurFilterContentsTest impeller::testing::MatrixFilterContentsTest

Public Types

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

 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 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::Mapping > OpenAssetAsMapping (std::string asset_name) const =0
 
virtual std::string GetWindowTitle () const =0
 
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 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)
 

Protected Member Functions

virtual bool ShouldKeepRendering () const
 
void SetWindowSize (ISize size)
 

Protected Attributes

const PlaygroundSwitches switches_
 

Detailed Description

Definition at line 47 of file playground.h.

Member Typedef Documentation

◆ GLProcAddressResolver

using impeller::Playground::GLProcAddressResolver = std::function<void*(const char* proc_name)>

Definition at line 117 of file playground.h.

◆ RenderCallback

using impeller::Playground::RenderCallback = std::function<bool(RenderTarget& render_target)>

Definition at line 80 of file playground.h.

◆ SinglePassCallback

using impeller::Playground::SinglePassCallback = std::function<bool(RenderPass& pass)>

Definition at line 49 of file playground.h.

Constructor & Destructor Documentation

◆ Playground()

impeller::Playground::Playground ( PlaygroundSwitches  switches)
explicit

◆ ~Playground()

impeller::Playground::~Playground ( )
virtualdefault

Member Function Documentation

◆ CreateGLProcAddressResolver()

Playground::GLProcAddressResolver impeller::Playground::CreateGLProcAddressResolver ( ) const

Definition at line 516 of file playground.cc.

517  {
518  return impl_->CreateGLProcAddressResolver();
519 }

Referenced by impeller::interop::testing::PlaygroundTest::CreateContext().

◆ CreateTextureCubeForFixture()

std::shared_ptr< Texture > impeller::Playground::CreateTextureCubeForFixture ( std::array< const char *, 6 >  fixture_names) const

Definition at line 454 of file playground.cc.

455  {
456  std::array<DecompressedImage, 6> images;
457  for (size_t i = 0; i < fixture_names.size(); i++) {
458  auto image = DecodeImageRGBA(
460  if (!image.has_value()) {
461  return nullptr;
462  }
463  images[i] = image.value();
464  }
465 
466  auto texture_descriptor = TextureDescriptor{};
467  texture_descriptor.storage_mode = StorageMode::kHostVisible;
468  texture_descriptor.type = TextureType::kTextureCube;
469  texture_descriptor.format = PixelFormat::kR8G8B8A8UNormInt;
470  texture_descriptor.size = images[0].GetSize();
471  texture_descriptor.mip_count = 1u;
472 
473  auto texture =
474  context_->GetResourceAllocator()->CreateTexture(texture_descriptor);
475  if (!texture) {
476  VALIDATION_LOG << "Could not allocate texture cube.";
477  return nullptr;
478  }
479  texture->SetLabel("Texture cube");
480 
481  auto cmd_buffer = context_->CreateCommandBuffer();
482  auto blit_pass = cmd_buffer->CreateBlitPass();
483  for (size_t i = 0; i < fixture_names.size(); i++) {
484  auto device_buffer = context_->GetResourceAllocator()->CreateBufferWithCopy(
485  *images[i].GetAllocation());
486  blit_pass->AddCopy(DeviceBuffer::AsBufferView(device_buffer), texture, {},
487  "", /*slice=*/i);
488  }
489 
490  if (!blit_pass->EncodeCommands(context_->GetResourceAllocator()) ||
491  !context_->GetCommandQueue()->Submit({std::move(cmd_buffer)}).ok()) {
492  VALIDATION_LOG << "Could not upload texture to device memory.";
493  return nullptr;
494  }
495 
496  return texture;
497 }

References impeller::DeviceBuffer::AsBufferView(), DecodeImageRGBA(), impeller::kHostVisible, impeller::kR8G8B8A8UNormInt, impeller::kTextureCube, LoadFixtureImageCompressed(), OpenAssetAsMapping(), impeller::TextureDescriptor::storage_mode, and VALIDATION_LOG.

◆ CreateTextureForFixture()

std::shared_ptr< Texture > impeller::Playground::CreateTextureForFixture ( const char *  fixture_name,
bool  enable_mipmapping = false 
) const

Definition at line 442 of file playground.cc.

444  {
445  auto texture = CreateTextureForMapping(
446  context_, OpenAssetAsMapping(fixture_name), enable_mipmapping);
447  if (texture == nullptr) {
448  return nullptr;
449  }
450  texture->SetLabel(fixture_name);
451  return texture;
452 }

References CreateTextureForMapping(), and OpenAssetAsMapping().

◆ CreateTextureForMapping()

std::shared_ptr< Texture > impeller::Playground::CreateTextureForMapping ( const std::shared_ptr< Context > &  context,
std::shared_ptr< fml::Mapping >  mapping,
bool  enable_mipmapping = false 
)
static

Definition at line 429 of file playground.cc.

432  {
433  auto image = Playground::DecodeImageRGBA(
434  Playground::LoadFixtureImageCompressed(std::move(mapping)));
435  if (!image.has_value()) {
436  return nullptr;
437  }
438  return CreateTextureForDecompressedImage(context, image.value(),
439  enable_mipmapping);
440 }

References impeller::CreateTextureForDecompressedImage(), DecodeImageRGBA(), and LoadFixtureImageCompressed().

Referenced by impeller::DlPlayground::CreateDlImageForFixture(), impeller::GoldenPlaygroundTest::CreateTextureForFixture(), and CreateTextureForFixture().

◆ DecodeImageRGBA()

std::optional< DecompressedImage > impeller::Playground::DecodeImageRGBA ( const std::shared_ptr< CompressedImage > &  compressed)
static

Definition at line 368 of file playground.cc.

369  {
370  if (compressed == nullptr) {
371  return std::nullopt;
372  }
373  // The decoded image is immediately converted into RGBA as that format is
374  // known to be supported everywhere. For image sources that don't need 32
375  // bit pixel strides, this is overkill. Since this is a test fixture we
376  // aren't necessarily trying to eke out memory savings here and instead
377  // favor simplicity.
378  auto image = compressed->Decode().ConvertToRGBA();
379  if (!image.IsValid()) {
380  VALIDATION_LOG << "Could not decode image.";
381  return std::nullopt;
382  }
383 
384  return image;
385 }

References VALIDATION_LOG.

Referenced by CreateTextureCubeForFixture(), and CreateTextureForMapping().

◆ GetContentScale()

Point impeller::Playground::GetContentScale ( ) const

◆ GetContext()

◆ GetCursorPosition()

Point impeller::Playground::GetCursorPosition ( ) const

Definition at line 177 of file playground.cc.

177  {
178  return cursor_position_;
179 }

◆ GetSecondsElapsed()

Scalar impeller::Playground::GetSecondsElapsed ( ) const

Get the amount of time elapsed from the start of the playground's execution.

Definition at line 189 of file playground.cc.

189  {
190  return (fml::TimePoint::Now().ToEpochDelta() - start_time_).ToSecondsF();
191 }

◆ GetWindowSize()

ISize impeller::Playground::GetWindowSize ( ) const

◆ GetWindowTitle()

virtual std::string impeller::Playground::GetWindowTitle ( ) const
pure virtual

◆ IsPlaygroundEnabled()

bool impeller::Playground::IsPlaygroundEnabled ( ) const

◆ LoadFixtureImageCompressed()

std::shared_ptr< CompressedImage > impeller::Playground::LoadFixtureImageCompressed ( std::shared_ptr< fml::Mapping >  mapping)
static

Definition at line 357 of file playground.cc.

358  {
359  auto compressed_image = CompressedImageSkia::Create(std::move(mapping));
360  if (!compressed_image) {
361  VALIDATION_LOG << "Could not create compressed image.";
362  return nullptr;
363  }
364 
365  return compressed_image;
366 }

References impeller::CompressedImageSkia::Create(), and VALIDATION_LOG.

Referenced by CreateTextureCubeForFixture(), and CreateTextureForMapping().

◆ MakeContext()

std::shared_ptr< Context > impeller::Playground::MakeContext ( ) const

Definition at line 94 of file playground.cc.

94  {
95  // Playgrounds are already making a context for each test, so we can just
96  // return the `context_`.
97  return context_;
98 }

◆ OpenAssetAsMapping()

virtual std::unique_ptr<fml::Mapping> impeller::Playground::OpenAssetAsMapping ( std::string  asset_name) const
pure virtual

◆ OpenPlaygroundHere() [1/2]

bool impeller::Playground::OpenPlaygroundHere ( const RenderCallback render_callback)

Definition at line 197 of file playground.cc.

198  {
200  return true;
201  }
202 
203  if (!render_callback) {
204  return true;
205  }
206 
207  IMGUI_CHECKVERSION();
208  ImGui::CreateContext();
209  fml::ScopedCleanupClosure destroy_imgui_context(
210  []() { ImGui::DestroyContext(); });
211  ImGui::StyleColorsDark();
212 
213  auto& io = ImGui::GetIO();
214  io.IniFilename = nullptr;
215  io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
216  io.ConfigWindowsResizeFromEdges = true;
217 
218  auto window = reinterpret_cast<GLFWwindow*>(impl_->GetWindowHandle());
219  if (!window) {
220  return false;
221  }
222  ::glfwSetWindowTitle(window, GetWindowTitle().c_str());
223  ::glfwSetWindowUserPointer(window, this);
224  ::glfwSetWindowSizeCallback(
225  window, [](GLFWwindow* window, int width, int height) -> void {
226  auto playground =
227  reinterpret_cast<Playground*>(::glfwGetWindowUserPointer(window));
228  if (!playground) {
229  return;
230  }
231  playground->SetWindowSize(ISize{width, height}.Max({}));
232  });
233  ::glfwSetKeyCallback(window, &PlaygroundKeyCallback);
234  ::glfwSetCursorPosCallback(window, [](GLFWwindow* window, double x,
235  double y) {
236  reinterpret_cast<Playground*>(::glfwGetWindowUserPointer(window))
237  ->SetCursorPosition({static_cast<Scalar>(x), static_cast<Scalar>(y)});
238  });
239 
240  ImGui_ImplGlfw_InitForOther(window, true);
241  fml::ScopedCleanupClosure shutdown_imgui([]() { ImGui_ImplGlfw_Shutdown(); });
242 
243  ImGui_ImplImpeller_Init(context_);
244  fml::ScopedCleanupClosure shutdown_imgui_impeller(
245  []() { ImGui_ImplImpeller_Shutdown(); });
246 
247  ImGui::SetNextWindowPos({10, 10});
248 
249  ::glfwSetWindowSize(window, GetWindowSize().width, GetWindowSize().height);
250  ::glfwSetWindowPos(window, 200, 100);
251  ::glfwShowWindow(window);
252 
253  while (true) {
254 #if FML_OS_MACOSX
255  fml::ScopedNSAutoreleasePool pool;
256 #endif
257  ::glfwPollEvents();
258 
259  if (::glfwWindowShouldClose(window)) {
260  return true;
261  }
262 
263  ImGui_ImplGlfw_NewFrame();
264 
265  auto surface = impl_->AcquireSurfaceFrame(context_);
266  RenderTarget render_target = surface->GetRenderTarget();
267 
268  ImGui::NewFrame();
269  ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(),
270  ImGuiDockNodeFlags_PassthruCentralNode);
271  bool result = render_callback(render_target);
272  ImGui::Render();
273 
274  // Render ImGui overlay.
275  {
276  auto buffer = context_->CreateCommandBuffer();
277  if (!buffer) {
278  VALIDATION_LOG << "Could not create command buffer.";
279  return false;
280  }
281  buffer->SetLabel("ImGui Command Buffer");
282 
283  if (render_target.GetColorAttachments().empty()) {
284  VALIDATION_LOG << "render target attachments are empty.";
285  return false;
286  }
287 
288  auto color0 = render_target.GetColorAttachments().find(0)->second;
289  color0.load_action = LoadAction::kLoad;
290  if (color0.resolve_texture) {
291  color0.texture = color0.resolve_texture;
292  color0.resolve_texture = nullptr;
293  color0.store_action = StoreAction::kStore;
294  }
295  render_target.SetColorAttachment(color0, 0);
296 
297  render_target.SetStencilAttachment(std::nullopt);
298  render_target.SetDepthAttachment(std::nullopt);
299 
300  auto pass = buffer->CreateRenderPass(render_target);
301  if (!pass) {
302  VALIDATION_LOG << "Could not create render pass.";
303  return false;
304  }
305  pass->SetLabel("ImGui Render Pass");
306 
307  ImGui_ImplImpeller_RenderDrawData(ImGui::GetDrawData(), *pass);
308 
309  pass->EncodeCommands();
310 
311  if (!context_->GetCommandQueue()->Submit({buffer}).ok()) {
312  return false;
313  }
314  }
315 
316  if (!result || !surface->Present()) {
317  return false;
318  }
319 
320  if (!ShouldKeepRendering()) {
321  break;
322  }
323  }
324 
325  ::glfwHideWindow(window);
326 
327  return true;
328 }

References impeller::PlaygroundSwitches::enable_playground, impeller::RenderTarget::GetColorAttachments(), GetWindowSize(), GetWindowTitle(), ImGui_ImplImpeller_Init(), ImGui_ImplImpeller_RenderDrawData(), ImGui_ImplImpeller_Shutdown(), impeller::kLoad, impeller::kStore, impeller::TSize< T >::Max(), impeller::PlaygroundKeyCallback(), impeller::RenderTarget::SetColorAttachment(), impeller::RenderTarget::SetDepthAttachment(), impeller::RenderTarget::SetStencilAttachment(), SetWindowSize(), ShouldKeepRendering(), switches_, and VALIDATION_LOG.

Referenced by impeller::EntityPlayground::OpenPlaygroundHere(), impeller::DlPlayground::OpenPlaygroundHere(), impeller::AiksPlayground::OpenPlaygroundHere(), impeller::interop::testing::PlaygroundTest::OpenPlaygroundHere(), OpenPlaygroundHere(), and impeller::testing::RendererDartTest::RenderDartToPlayground().

◆ OpenPlaygroundHere() [2/2]

bool impeller::Playground::OpenPlaygroundHere ( SinglePassCallback  pass_callback)

Definition at line 330 of file playground.cc.

330  {
331  return OpenPlaygroundHere(
332  [context = GetContext(), &pass_callback](RenderTarget& render_target) {
333  auto buffer = context->CreateCommandBuffer();
334  if (!buffer) {
335  return false;
336  }
337  buffer->SetLabel("Playground Command Buffer");
338 
339  auto pass = buffer->CreateRenderPass(render_target);
340  if (!pass) {
341  return false;
342  }
343  pass->SetLabel("Playground Render Pass");
344 
345  if (!pass_callback(*pass)) {
346  return false;
347  }
348 
349  pass->EncodeCommands();
350  if (!context->GetCommandQueue()->Submit({buffer}).ok()) {
351  return false;
352  }
353  return true;
354  });
355 }

References GetContext(), and OpenPlaygroundHere().

◆ SetCapabilities()

fml::Status impeller::Playground::SetCapabilities ( const std::shared_ptr< Capabilities > &  capabilities)

Definition at line 507 of file playground.cc.

508  {
509  return impl_->SetCapabilities(capabilities);
510 }

◆ SetupContext()

void impeller::Playground::SetupContext ( PlaygroundBackend  backend,
const PlaygroundSwitches switches 
)

Definition at line 124 of file playground.cc.

125  {
126  FML_CHECK(SupportsBackend(backend));
127 
128  impl_ = PlaygroundImpl::Create(backend, switches);
129  if (!impl_) {
130  FML_LOG(WARNING) << "PlaygroundImpl::Create failed.";
131  return;
132  }
133 
134  context_ = impl_->GetContext();
135 }

References impeller::PlaygroundImpl::Create(), and SupportsBackend().

Referenced by impeller::ComputePlaygroundTest::SetUp(), and impeller::PlaygroundTest::SetUp().

◆ SetupWindow()

void impeller::Playground::SetupWindow ( )

Definition at line 137 of file playground.cc.

137  {
138  if (!context_) {
139  FML_LOG(WARNING) << "Asked to set up a window with no context (call "
140  "SetupContext first).";
141  return;
142  }
143  start_time_ = fml::TimePoint::Now().ToEpochDelta();
144 }

Referenced by impeller::ComputePlaygroundTest::SetUp(), and impeller::PlaygroundTest::SetUp().

◆ SetWindowSize()

void impeller::Playground::SetWindowSize ( ISize  size)
protected

Definition at line 499 of file playground.cc.

499  {
500  window_size_ = size;
501 }

Referenced by OpenPlaygroundHere().

◆ ShouldKeepRendering()

bool impeller::Playground::ShouldKeepRendering ( ) const
protectedvirtual

Definition at line 503 of file playground.cc.

503  {
504  return true;
505 }

Referenced by OpenPlaygroundHere().

◆ ShouldOpenNewPlaygrounds()

bool impeller::Playground::ShouldOpenNewPlaygrounds ( )
static

◆ SupportsBackend()

bool impeller::Playground::SupportsBackend ( PlaygroundBackend  backend)
static

Definition at line 100 of file playground.cc.

100  {
101  switch (backend) {
103 #if IMPELLER_ENABLE_METAL
104  return true;
105 #else // IMPELLER_ENABLE_METAL
106  return false;
107 #endif // IMPELLER_ENABLE_METAL
109 #if IMPELLER_ENABLE_OPENGLES
110  return true;
111 #else // IMPELLER_ENABLE_OPENGLES
112  return false;
113 #endif // IMPELLER_ENABLE_OPENGLES
115 #if IMPELLER_ENABLE_VULKAN
117 #else // IMPELLER_ENABLE_VULKAN
118  return false;
119 #endif // IMPELLER_ENABLE_VULKAN
120  }
121  FML_UNREACHABLE();
122 }

References impeller::PlaygroundImplVK::IsVulkanDriverPresent(), impeller::kMetal, impeller::kOpenGLES, and impeller::kVulkan.

Referenced by impeller::ComputePlaygroundTest::SetUp(), impeller::PlaygroundTest::SetUp(), and SetupContext().

◆ TeardownWindow()

void impeller::Playground::TeardownWindow ( )

Definition at line 150 of file playground.cc.

150  {
151  if (context_) {
152  context_->Shutdown();
153  }
154  context_.reset();
155  impl_.reset();
156 }

Referenced by impeller::ComputePlaygroundTest::TearDown(), and impeller::PlaygroundTest::TearDown().

◆ WillRenderSomething()

bool impeller::Playground::WillRenderSomething ( ) const

Returns true if OpenPlaygroundHere will actually render anything.

Definition at line 512 of file playground.cc.

512  {
514 }

References impeller::PlaygroundSwitches::enable_playground, and switches_.

Member Data Documentation

◆ switches_


The documentation for this class was generated from the following files:
impeller::DeviceBuffer::AsBufferView
static BufferView AsBufferView(std::shared_ptr< DeviceBuffer > buffer)
Create a buffer view of this entire buffer.
Definition: device_buffer.cc:18
impeller::ISize
ISize64 ISize
Definition: size.h:140
impeller::PlaygroundImplVK::IsVulkanDriverPresent
static bool IsVulkanDriverPresent()
Definition: playground_impl_vk.cc:220
impeller::LoadAction::kLoad
@ kLoad
impeller::PlaygroundBackend::kVulkan
@ kVulkan
impeller::CreateTextureForDecompressedImage
static std::shared_ptr< Texture > CreateTextureForDecompressedImage(const std::shared_ptr< Context > &context, DecompressedImage &decompressed_image, bool enable_mipmapping)
Definition: playground.cc:387
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::Playground::ShouldKeepRendering
virtual bool ShouldKeepRendering() const
Definition: playground.cc:503
impeller::Playground::DecodeImageRGBA
static std::optional< DecompressedImage > DecodeImageRGBA(const std::shared_ptr< CompressedImage > &compressed)
Definition: playground.cc:368
impeller::Playground::GetWindowSize
ISize GetWindowSize() const
Definition: playground.cc:181
impeller::PlaygroundBackend::kMetal
@ kMetal
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::PlaygroundKeyCallback
static void PlaygroundKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
Definition: playground.cc:164
impeller::CompressedImageSkia::Create
static std::shared_ptr< CompressedImage > Create(std::shared_ptr< const fml::Mapping > allocation)
Definition: compressed_image_skia.cc:18
impeller::StorageMode::kHostVisible
@ kHostVisible
impeller::PlaygroundSwitches::use_swiftshader
bool use_swiftshader
Definition: switches.h:27
impeller::Playground::OpenPlaygroundHere
bool OpenPlaygroundHere(const RenderCallback &render_callback)
Definition: playground.cc:197
impeller::gShouldOpenNewPlaygrounds
static std::atomic_bool gShouldOpenNewPlaygrounds
Definition: playground.cc:158
impeller::TSize::Max
constexpr TSize Max(const TSize &o) const
Definition: size.h:81
impeller::InitializeGLFWOnce
static void InitializeGLFWOnce()
Definition: playground.cc:57
impeller::Playground::switches_
const PlaygroundSwitches switches_
Definition: playground.h:121
impeller::TextureType::kTextureCube
@ kTextureCube
impeller::StoreAction::kStore
@ kStore
impeller::PlaygroundImpl::Create
static std::unique_ptr< PlaygroundImpl > Create(PlaygroundBackend backend, PlaygroundSwitches switches)
Definition: playground_impl.cc:25
ImGui_ImplImpeller_Shutdown
void ImGui_ImplImpeller_Shutdown()
Definition: imgui_impl_impeller.cc:119
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91
ImGui_ImplImpeller_RenderDrawData
void ImGui_ImplImpeller_RenderDrawData(ImDrawData *draw_data, impeller::RenderPass &render_pass)
Definition: imgui_impl_impeller.cc:126
impeller::PlaygroundBackend::kOpenGLES
@ kOpenGLES
impeller::Playground::CreateTextureForMapping
static std::shared_ptr< Texture > CreateTextureForMapping(const std::shared_ptr< Context > &context, std::shared_ptr< fml::Mapping > mapping, bool enable_mipmapping=false)
Definition: playground.cc:429
impeller::Playground::LoadFixtureImageCompressed
static std::shared_ptr< CompressedImage > LoadFixtureImageCompressed(std::shared_ptr< fml::Mapping > mapping)
Definition: playground.cc:357
impeller::Playground::GetWindowTitle
virtual std::string GetWindowTitle() const =0
impeller::Playground::OpenAssetAsMapping
virtual std::unique_ptr< fml::Mapping > OpenAssetAsMapping(std::string asset_name) const =0
impeller::SetupSwiftshaderOnce
void SetupSwiftshaderOnce(bool use_swiftshader)
Find and setup the installable client driver for a locally built SwiftShader at known paths....
Definition: swiftshader_utilities.cc:54
impeller::Playground::SupportsBackend
static bool SupportsBackend(PlaygroundBackend backend)
Definition: playground.cc:100
ImGui_ImplImpeller_Init
bool ImGui_ImplImpeller_Init(const std::shared_ptr< impeller::Context > &context)
Definition: imgui_impl_impeller.cc:56
impeller::Playground::Playground
Playground(PlaygroundSwitches switches)
Definition: playground.cc:83
impeller::Playground::GetContext
std::shared_ptr< Context > GetContext() const
Definition: playground.cc:90
impeller::PlaygroundSwitches::enable_playground
bool enable_playground
Definition: switches.h:16