• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_IMAGE_H_
6 #define FLUTTER_VULKAN_VULKAN_IMAGE_H_
7 
8 #ifndef RS_ENABLE_VK
9 #include "flutter/fml/compiler_specific.h"
10 #include "flutter/fml/macros.h"
11 #endif
12 #include "flutter/vulkan/vulkan_handle.h"
13 
14 namespace vulkan {
15 
16 class VulkanProcTable;
17 class VulkanCommandBuffer;
18 
19 class VulkanImage {
20  public:
21   VulkanImage(VulkanHandle<VkImage> image);
22 
23   ~VulkanImage();
24 
25   bool IsValid() const;
26 
27 #ifndef RS_ENABLE_VK
28   FML_WARN_UNUSED_RESULT
29 #endif
30   bool InsertImageMemoryBarrier(const VulkanCommandBuffer& command_buffer,
31                                 VkPipelineStageFlagBits src_pipline_bits,
32                                 VkPipelineStageFlagBits dest_pipline_bits,
33                                 VkAccessFlagBits dest_access_flags,
34                                 VkImageLayout dest_layout);
35 
36  private:
37   VulkanHandle<VkImage> handle_;
38   VkImageLayout layout_;
39   uint32_t /* mask of VkAccessFlagBits */ access_flags_;
40   bool valid_;
41 
42 #ifndef RS_ENABLE_VK
43   FML_DISALLOW_COPY_AND_ASSIGN(VulkanImage);
44 #endif
45 };
46 
47 }  // namespace vulkan
48 
49 #endif  // FLUTTER_VULKAN_VULKAN_IMAGE_H_
50