Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
vulkan_window.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_VULKAN_VULKAN_WINDOW_H_
6#define FLUTTER_VULKAN_VULKAN_WINDOW_H_
7
8#include <memory>
9#include <tuple>
10#include <utility>
11#include <vector>
12
13#include "flutter/fml/compiler_specific.h"
14#include "flutter/fml/macros.h"
15#include "flutter/vulkan/procs/vulkan_proc_table.h"
21
22namespace vulkan {
23
24class VulkanNativeSurface;
25class VulkanDevice;
26class VulkanSurface;
27class VulkanSwapchain;
28class VulkanImage;
29class VulkanApplication;
30class VulkanBackbuffer;
31
33 public:
34 //------------------------------------------------------------------------------
35 /// @brief Construct a VulkanWindow. Let it implicitly create a
36 /// GrDirectContext.
37 ///
39 std::unique_ptr<VulkanNativeSurface> native_surface);
40
41 //------------------------------------------------------------------------------
42 /// @brief Construct a VulkanWindow. Let reuse an existing
43 /// GrDirectContext built by another VulkanWindow.
44 ///
47 std::unique_ptr<VulkanNativeSurface> native_surface);
48
50
51 bool IsValid() const;
52
54
56
58
59 private:
60 bool valid_;
62 std::unique_ptr<VulkanApplication> application_;
63 std::unique_ptr<VulkanDevice> logical_device_;
64 std::unique_ptr<VulkanSurface> surface_;
65 std::unique_ptr<VulkanSwapchain> swapchain_;
67 sk_sp<GrDirectContext> skia_gr_context_;
68
69 bool CreateSkiaGrContext();
70
71 bool CreateSkiaBackendContext(GrVkBackendContext* context);
72
73 [[nodiscard]] bool RecreateSwapchain();
74
76};
77
78} // namespace vulkan
79
80#endif // FLUTTER_VULKAN_VULKAN_WINDOW_H_
VulkanWindow(const sk_sp< GrDirectContext > &context, fml::RefPtr< VulkanProcTable > proc_table, std::unique_ptr< VulkanNativeSurface > native_surface)
Construct a VulkanWindow. Let reuse an existing GrDirectContext built by another VulkanWindow.
sk_sp< SkSurface > AcquireSurface()
bool IsValid() const
GrDirectContext * GetSkiaGrContext()
VulkanWindow(fml::RefPtr< VulkanProcTable > proc_table, std::unique_ptr< VulkanNativeSurface > native_surface)
Construct a VulkanWindow. Let it implicitly create a GrDirectContext.
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27