blob: 37c847a92a99e79c4895cf30d84ef1e851e12ce1 [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/concurrent_message_loop.h"
#include "flutter/fml/macros.h"
#include "impeller/playground/playground_impl.h"
#include "impeller/renderer/backend/vulkan/swapchain_vk.h"
#include "impeller/renderer/backend/vulkan/vk.h"
namespace impeller {
class PlaygroundImplVK final : public PlaygroundImpl {
public:
PlaygroundImplVK();
~PlaygroundImplVK();
private:
std::shared_ptr<fml::ConcurrentMessageLoop> concurrent_loop_;
std::shared_ptr<Context> context_;
size_t current_frame_ = 0;
// windows
static void DestroyWindowHandle(WindowHandle handle);
using UniqueHandle = std::unique_ptr<void, decltype(&DestroyWindowHandle)>;
UniqueHandle handle_;
// |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;
void SetupSwapchain();
FML_DISALLOW_COPY_AND_ASSIGN(PlaygroundImplVK);
};
} // namespace impeller