2 * Copyright (c) 2017-2019, 2021 Arm Limited.
4 * SPDX-License-Identifier: MIT
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 #include "wsi/swapchain_base_tizen.hpp"
30 #include <vulkan/vk_icd.h>
33 #include <tbm_surface.h>
34 #include <tbm_surface_internal.h>
42 class swapchain : public wsi::swapchain_base
45 explicit swapchain(layer::device_private_data &dev_data, const VkAllocationCallbacks *allocator);
51 * @brief Initialize platform specifics.
53 VkResult init_platform(VkDevice device, const VkSwapchainCreateInfoKHR *pSwapchainCreateInfo) override;
56 * @brief Creates swapchain images.
58 * @param image_create_info Data to be used to create the image.
60 * @return If image creation is successful returns VK_SUCCESS, otherwise
61 * will return VK_ERROR_OUT_OF_DEVICE_MEMORY or VK_ERROR_INITIALIZATION_FAILED
62 * depending on the error that occurred.
64 VkResult create_image(const VkImageCreateInfo &image_create_info) override;
66 VkResult acquire_image(uint32_t *image_index) override;
69 * @brief Method to present an image
71 * @param pendingIndex Index of the pending image to be presented.
73 void present_image(uint32_t pendingIndex) override;
76 * @brief Method to release a swapchain image
78 * @param image Handle to the image about to be released.
80 void destroy_image(void) override;
83 struct tizen_image_data;
84 VkResult allocate_image(const VkImageCreateInfo &image_create_info, tizen_image_data *image_data, VkImage *image);
86 tpl_display_t *m_tpl_display;
87 tpl_surface_t *m_tpl_surface;
90 } // namespace wayland