| Flutter Impeller |

context_vk.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_IMPELLER_TOOLKIT_INTEROP_BACKEND_VULKAN_CONTEXT_VK_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_BACKEND_VULKAN_CONTEXT_VK_H_
7
8 #include "impeller/renderer/backend/vulkan/vk.h"
9 #include "impeller/toolkit/interop/context.h"
10 #include "impeller/toolkit/interop/impeller.h"
11
12 namespace impeller::interop {
13
14 class ContextVK final : public Context {
15 public:
16 struct Settings {
17 std::function<PFN_vkVoidFunction(VkInstance instance,
18 const char* proc_name)>
19 instance_proc_address_callback;
20 bool enable_validation = false;
21
22 explicit Settings(const ImpellerContextVulkanSettings& settings);
23
24 bool IsValid() const;
25 };
26
27 static ScopedObject<Context> Create(const Settings& settings);
28
29 static ScopedObject<Context> Create(
30 std::shared_ptr<impeller::Context> context);
31
32 // |Context|
33 ~ContextVK() override;
34
35 ContextVK(const ContextVK&) = delete;
36
37 ContextVK& operator=(const ContextVK&) = delete;
38
39 bool GetInfo(ImpellerContextVulkanInfo& info) const;
40
41 private:
42 explicit ContextVK(std::shared_ptr<impeller::Context> context);
43 };
44
45 } // namespace impeller::interop
46
47 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_BACKEND_VULKAN_CONTEXT_VK_H_
impeller::interop::Context
Definition: context.h:16
impeller::interop::ContextVK
Definition: context_vk.h:14
impeller::interop::ContextVK::ContextVK
ContextVK(const ContextVK &)=delete
impeller::interop::ContextVK::GetInfo
bool GetInfo(ImpellerContextVulkanInfo &info) const
Definition: context_vk.cc:97
impeller::interop::ContextVK::operator=
ContextVK & operator=(const ContextVK &)=delete
impeller::interop::ContextVK::~ContextVK
~ContextVK() override
impeller::interop::ContextVK::Create
static ScopedObject< Context > Create(const Settings &settings)
Definition: context_vk.cc:44
impeller::interop::ScopedObject
Definition: object.h:67
impeller.h
impeller::interop
Definition: context_gles.cc:12
ImpellerContextVulkanInfo
Definition: impeller.h:638
ImpellerContextVulkanSettings
Definition: impeller.h:632
impeller::interop::ContextVK::Settings
Definition: context_vk.h:16
impeller::interop::ContextVK::Settings::Settings
Settings(const ImpellerContextVulkanSettings &settings)
Definition: context_vk.cc:83
impeller::interop::ContextVK::Settings::enable_validation
bool enable_validation
Definition: context_vk.h:20
impeller::interop::ContextVK::Settings::instance_proc_address_callback
std::function< PFN_vkVoidFunction(VkInstance instance, const char *proc_name)> instance_proc_address_callback
Definition: context_vk.h:19
impeller::interop::ContextVK::Settings::IsValid
bool IsValid() const
Definition: context_vk.cc:115
context.h
vk.h