67 handle_(
nullptr, &DestroyWindowHandle),
68 data_(std::make_unique<Data>()),
70 is_gpu_disabled_sync_switch_(
new fml::SyncSwitch(
false)) {
71 ::glfwDefaultWindowHints();
72 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
73 ::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
74 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
81 is_gpu_disabled_sync_switch_,
"Playground Library",
82 switches.enable_wide_gamut
88 NSWindow* cocoa_window = ::glfwGetCocoaWindow(window);
89 if (cocoa_window == nil) {
92 data_->metal_layer = [CAMetalLayer layer];
94 data_->metal_layer.pixelFormat =
96 data_->metal_layer.framebufferOnly = NO;
97 cocoa_window.contentView.layer = data_->metal_layer;
98 cocoa_window.contentView.wantsLayer = YES;
100 handle_.reset(window);
101 context_ = std::move(context);
102 swapchain_transients_ = std::make_shared<SwapchainTransientsMTL>(
103 context_->GetResourceAllocator());
static ContextMTL & Cast(Context &base)
static std::shared_ptr< ContextMTL > Create(const Flags &flags, const std::vector< std::string > &shader_library_paths, std::shared_ptr< const fml::SyncSwitch > is_gpu_disabled_sync_switch)
id< MTLDevice > GetMTLDevice() const
PlaygroundImpl(PlaygroundSwitches switches)
ScopedObject< Object > Create(CtorArgs &&... args)
static std::vector< std::shared_ptr< fml::Mapping > > ShaderLibraryMappingsForPlayground()
constexpr MTLPixelFormat ToMTLPixelFormat(PixelFormat format)