| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ | 5 #ifndef GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ |
| 6 #define GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ | 6 #define GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 #include <vulkan/vulkan.h> | 10 #include <vulkan/vulkan.h> |
| 10 | 11 |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "gpu/vulkan/vulkan_export.h" | 12 #include "gpu/vulkan/vulkan_export.h" |
| 13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 14 #include "ui/gfx/swap_result.h" | 14 #include "ui/gfx/swap_result.h" |
| 15 | 15 |
| 16 namespace gpu { | 16 namespace gpu { |
| 17 | 17 |
| 18 class VulkanCommandBuffer; | 18 class VulkanCommandBuffer; |
| 19 class VulkanCommandPool; | 19 class VulkanCommandPool; |
| 20 class VulkanDeviceQueue; | 20 class VulkanDeviceQueue; |
| 21 class VulkanImageView; | 21 class VulkanImageView; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const VkSurfaceFormatKHR& surface_format); | 57 const VkSurfaceFormatKHR& surface_format); |
| 58 void DestroySwapChain(); | 58 void DestroySwapChain(); |
| 59 | 59 |
| 60 bool InitializeSwapImages(const VkSurfaceCapabilitiesKHR& surface_caps, | 60 bool InitializeSwapImages(const VkSurfaceCapabilitiesKHR& surface_caps, |
| 61 const VkSurfaceFormatKHR& surface_format); | 61 const VkSurfaceFormatKHR& surface_format); |
| 62 void DestroySwapImages(); | 62 void DestroySwapImages(); |
| 63 | 63 |
| 64 VulkanDeviceQueue* device_queue_; | 64 VulkanDeviceQueue* device_queue_; |
| 65 VkSwapchainKHR swap_chain_ = VK_NULL_HANDLE; | 65 VkSwapchainKHR swap_chain_ = VK_NULL_HANDLE; |
| 66 | 66 |
| 67 scoped_ptr<VulkanCommandPool> command_pool_; | 67 std::unique_ptr<VulkanCommandPool> command_pool_; |
| 68 | 68 |
| 69 gfx::Size size_; | 69 gfx::Size size_; |
| 70 | 70 |
| 71 struct ImageData { | 71 struct ImageData { |
| 72 ImageData(); | 72 ImageData(); |
| 73 ~ImageData(); | 73 ~ImageData(); |
| 74 | 74 |
| 75 VkImage image = VK_NULL_HANDLE; | 75 VkImage image = VK_NULL_HANDLE; |
| 76 scoped_ptr<VulkanImageView> image_view; | 76 std::unique_ptr<VulkanImageView> image_view; |
| 77 scoped_ptr<VulkanCommandBuffer> command_buffer; | 77 std::unique_ptr<VulkanCommandBuffer> command_buffer; |
| 78 | 78 |
| 79 VkSemaphore render_semaphore = VK_NULL_HANDLE; | 79 VkSemaphore render_semaphore = VK_NULL_HANDLE; |
| 80 VkSemaphore present_semaphore = VK_NULL_HANDLE; | 80 VkSemaphore present_semaphore = VK_NULL_HANDLE; |
| 81 }; | 81 }; |
| 82 std::vector<scoped_ptr<ImageData>> images_; | 82 std::vector<std::unique_ptr<ImageData>> images_; |
| 83 uint32_t current_image_ = 0; | 83 uint32_t current_image_ = 0; |
| 84 | 84 |
| 85 VkSemaphore next_present_semaphore_ = VK_NULL_HANDLE; | 85 VkSemaphore next_present_semaphore_ = VK_NULL_HANDLE; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace gpu | 88 } // namespace gpu |
| 89 | 89 |
| 90 #endif // GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ | 90 #endif // GPU_VULKAN_VULKAN_SWAP_CHAIN_H_ |
| OLD | NEW |