Flutter Engine
vulkan_backbuffer.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_BACKBUFFER_H_
6 #define FLUTTER_VULKAN_VULKAN_BACKBUFFER_H_
7 
8 #include <array>
9 
10 #include "flutter/fml/compiler_specific.h"
11 #include "flutter/fml/macros.h"
12 #include "third_party/skia/include/core/SkSize.h"
13 #include "third_party/skia/include/core/SkSurface.h"
14 #include "vulkan_command_buffer.h"
15 #include "vulkan_handle.h"
16 
17 namespace vulkan {
18 
20  public:
22  const VulkanHandle<VkDevice>& device,
23  const VulkanHandle<VkCommandPool>& pool);
24 
26 
27  bool IsValid() const;
28 
29  [[nodiscard]] bool WaitFences();
30 
31  [[nodiscard]] bool ResetFences();
32 
33  const VulkanHandle<VkFence>& GetUsageFence() const;
34 
36 
38 
40 
42 
44 
45  private:
46  const VulkanProcTable& vk;
47  const VulkanHandle<VkDevice>& device_;
48  std::array<VulkanHandle<VkSemaphore>, 2> semaphores_;
49  std::array<VulkanHandle<VkFence>, 2> use_fences_;
50  VulkanCommandBuffer usage_command_buffer_;
51  VulkanCommandBuffer render_command_buffer_;
52  bool valid_;
53 
54  bool CreateSemaphores();
55 
56  bool CreateFences();
57 
58  FML_DISALLOW_COPY_AND_ASSIGN(VulkanBackbuffer);
59 };
60 
61 } // namespace vulkan
62 
63 #endif // FLUTTER_VULKAN_VULKAN_BACKBUFFER_H_
VulkanCommandBuffer & GetUsageCommandBuffer()
const VulkanHandle< VkSemaphore > & GetUsageSemaphore() const
const VulkanHandle< VkSemaphore > & GetRenderSemaphore() const
VulkanCommandBuffer & GetRenderCommandBuffer()
const VulkanHandle< VkFence > & GetRenderFence() const
const VulkanHandle< VkFence > & GetUsageFence() const
VulkanBackbuffer(const VulkanProcTable &vk, const VulkanHandle< VkDevice > &device, const VulkanHandle< VkCommandPool > &pool)