blob: 0fa614224a42e2863398bc4ad4805bb45a480f61 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include "flutter/fml/macros.h"
#include "impeller/playground/playground_impl.h"
#include "impeller/renderer/backend/vulkan/vk.h"
namespace impeller {
class PlaygroundImplVK final : public PlaygroundImpl {
public:
explicit PlaygroundImplVK(PlaygroundSwitches switches);
~PlaygroundImplVK();
private:
std::shared_ptr<Context> context_;
// Windows management.
static void DestroyWindowHandle(WindowHandle handle);
using UniqueHandle = std::unique_ptr<void, decltype(&DestroyWindowHandle)>;
UniqueHandle handle_;
// A global Vulkan instance which ensures that the Vulkan library will remain
// loaded throughout the lifetime of the process.
static vk::UniqueInstance global_instance_;
// |PlaygroundImpl|
std::shared_ptr<Context> GetContext() const override;
// |PlaygroundImpl|
WindowHandle GetWindowHandle() const override;
// |PlaygroundImpl|
std::unique_ptr<Surface> AcquireSurfaceFrame(
std::shared_ptr<Context> context) override;
PlaygroundImplVK(const PlaygroundImplVK&) = delete;
PlaygroundImplVK& operator=(const PlaygroundImplVK&) = delete;
static void InitGlobalVulkanInstance();
};
} // namespace impeller