Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef VULKANMANAGER_H |
| 18 | #define VULKANMANAGER_H |
| 19 | |
Greg Daniel | 22cc59d | 2018-07-24 13:46:10 -0400 | [diff] [blame] | 20 | #if !defined(VK_USE_PLATFORM_ANDROID_KHR) |
| 21 | # define VK_USE_PLATFORM_ANDROID_KHR |
| 22 | #endif |
| 23 | #include <vulkan/vulkan.h> |
| 24 | |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 25 | #include <GrContextOptions.h> |
| 26 | #include <vk/GrVkExtensions.h> |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 27 | #include <SkSurface.h> |
Stan Iliev | 564ca3e | 2018-09-04 22:00:00 +0000 | [diff] [blame] | 28 | #include <ui/Fence.h> |
| 29 | #include <utils/StrongPointer.h> |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 30 | #include <vk/GrVkBackendContext.h> |
Stan Iliev | 79351f3 | 2018-09-19 14:23:49 -0400 | [diff] [blame] | 31 | #include "IRenderPipeline.h" |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 32 | |
Greg Daniel | a227dbb | 2018-08-20 09:19:48 -0400 | [diff] [blame] | 33 | class GrVkExtensions; |
| 34 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 35 | namespace android { |
| 36 | namespace uirenderer { |
| 37 | namespace renderthread { |
| 38 | |
| 39 | class RenderThread; |
| 40 | |
| 41 | class VulkanSurface { |
| 42 | public: |
Peiyong Lin | 3bff135 | 2018-12-11 07:56:07 -0800 | [diff] [blame] | 43 | VulkanSurface(ColorMode colorMode, ANativeWindow* window, sk_sp<SkColorSpace> colorSpace, |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 44 | SkColorType colorType, GrContext* grContext) |
Peiyong Lin | 3bff135 | 2018-12-11 07:56:07 -0800 | [diff] [blame] | 45 | : mColorMode(colorMode), mNativeWindow(window), mColorSpace(colorSpace), |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 46 | mColorType(colorType), mGrContext(grContext) {} |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 47 | |
| 48 | sk_sp<SkSurface> getBackBufferSurface() { return mBackbuffer; } |
| 49 | |
Greg Daniel | c407678 | 2019-01-08 16:01:18 -0500 | [diff] [blame] | 50 | // The width and height are are the logical width and height for when submitting draws to the |
| 51 | // surface. In reality if the window is rotated the underlying VkImage may have the width and |
| 52 | // height swapped. |
| 53 | int windowWidth() const { return mWindowWidth; } |
| 54 | int windowHeight() const { return mWindowHeight; } |
| 55 | |
| 56 | SkMatrix& preTransform() { return mPreTransform; } |
| 57 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 58 | private: |
| 59 | friend class VulkanManager; |
| 60 | struct BackbufferInfo { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 61 | uint32_t mImageIndex; // image this is associated with |
| 62 | VkSemaphore mAcquireSemaphore; // we signal on this for acquisition of image |
| 63 | VkSemaphore mRenderSemaphore; // we wait on this for rendering to be done |
| 64 | VkCommandBuffer |
| 65 | mTransitionCmdBuffers[2]; // to transition layout between present and render |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 66 | // We use these fences to make sure the above Command buffers have finished their work |
| 67 | // before attempting to reuse them or destroy them. |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 68 | VkFence mUsageFences[2]; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 69 | }; |
| 70 | |
Greg Daniel | cd55852 | 2016-11-17 13:31:40 -0500 | [diff] [blame] | 71 | struct ImageInfo { |
| 72 | VkImageLayout mImageLayout = VK_IMAGE_LAYOUT_UNDEFINED; |
| 73 | sk_sp<SkSurface> mSurface; |
| 74 | uint16_t mLastUsed = 0; |
| 75 | bool mInvalid = true; |
| 76 | }; |
| 77 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 78 | sk_sp<SkSurface> mBackbuffer; |
| 79 | |
| 80 | VkSurfaceKHR mVkSurface = VK_NULL_HANDLE; |
| 81 | VkSwapchainKHR mSwapchain = VK_NULL_HANDLE; |
| 82 | |
Greg Daniel | 74ea201 | 2017-11-10 11:32:58 -0500 | [diff] [blame] | 83 | BackbufferInfo* mBackbuffers = nullptr; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 84 | uint32_t mCurrentBackbufferIndex; |
| 85 | |
| 86 | uint32_t mImageCount; |
Greg Daniel | 74ea201 | 2017-11-10 11:32:58 -0500 | [diff] [blame] | 87 | VkImage* mImages = nullptr; |
Greg Daniel | cd55852 | 2016-11-17 13:31:40 -0500 | [diff] [blame] | 88 | ImageInfo* mImageInfos; |
| 89 | uint16_t mCurrentTime = 0; |
Stan Iliev | 79351f3 | 2018-09-19 14:23:49 -0400 | [diff] [blame] | 90 | ColorMode mColorMode; |
Stan Iliev | 305e13a | 2018-11-13 11:14:48 -0500 | [diff] [blame] | 91 | ANativeWindow* mNativeWindow; |
| 92 | int mWindowWidth = 0; |
| 93 | int mWindowHeight = 0; |
Stan Iliev | 987a80c0 | 2018-12-04 10:07:21 -0500 | [diff] [blame] | 94 | sk_sp<SkColorSpace> mColorSpace; |
Peiyong Lin | 3bff135 | 2018-12-11 07:56:07 -0800 | [diff] [blame] | 95 | SkColorType mColorType; |
Greg Daniel | c407678 | 2019-01-08 16:01:18 -0500 | [diff] [blame] | 96 | VkSurfaceTransformFlagBitsKHR mTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; |
| 97 | SkMatrix mPreTransform; |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 98 | GrContext* mGrContext; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 99 | }; |
| 100 | |
| 101 | // This class contains the shared global Vulkan objects, such as VkInstance, VkDevice and VkQueue, |
| 102 | // which are re-used by CanvasContext. This class is created once and should be used by all vulkan |
| 103 | // windowing contexts. The VulkanManager must be initialized before use. |
| 104 | class VulkanManager { |
| 105 | public: |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 106 | explicit VulkanManager() {} |
| 107 | ~VulkanManager() { destroy(); } |
| 108 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 109 | // Sets up the vulkan context that is shared amonst all clients of the VulkanManager. This must |
| 110 | // be call once before use of the VulkanManager. Multiple calls after the first will simiply |
| 111 | // return. |
| 112 | void initialize(); |
| 113 | |
| 114 | // Quick check to see if the VulkanManager has been initialized. |
Greg Daniel | 2f9d867 | 2018-06-22 10:44:26 -0400 | [diff] [blame] | 115 | bool hasVkContext() { return mDevice != VK_NULL_HANDLE; } |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 116 | |
| 117 | // Given a window this creates a new VkSurfaceKHR and VkSwapchain and stores them inside a new |
| 118 | // VulkanSurface object which is returned. |
Stan Iliev | 987a80c0 | 2018-12-04 10:07:21 -0500 | [diff] [blame] | 119 | VulkanSurface* createSurface(ANativeWindow* window, ColorMode colorMode, |
Peiyong Lin | 3bff135 | 2018-12-11 07:56:07 -0800 | [diff] [blame] | 120 | sk_sp<SkColorSpace> surfaceColorSpace, |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 121 | SkColorType surfaceColorType, |
| 122 | GrContext* grContext); |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 123 | |
| 124 | // Destroy the VulkanSurface and all associated vulkan objects. |
| 125 | void destroySurface(VulkanSurface* surface); |
| 126 | |
| 127 | // Cleans up all the global state in the VulkanManger. |
| 128 | void destroy(); |
| 129 | |
| 130 | // No work is needed to make a VulkanSurface current, and all functions require that a |
| 131 | // VulkanSurface is passed into them so we just return true here. |
| 132 | bool isCurrent(VulkanSurface* surface) { return true; } |
| 133 | |
Greg Daniel | cd55852 | 2016-11-17 13:31:40 -0500 | [diff] [blame] | 134 | int getAge(VulkanSurface* surface); |
| 135 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 136 | // Returns an SkSurface which wraps the next image returned from vkAcquireNextImageKHR. It also |
| 137 | // will transition the VkImage from a present layout to color attachment so that it can be used |
| 138 | // by the client for drawing. |
Stan Iliev | 305e13a | 2018-11-13 11:14:48 -0500 | [diff] [blame] | 139 | SkSurface* getBackbufferSurface(VulkanSurface** surface); |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 140 | |
| 141 | // Presents the current VkImage. |
| 142 | void swapBuffers(VulkanSurface* surface); |
| 143 | |
Stan Iliev | 564ca3e | 2018-09-04 22:00:00 +0000 | [diff] [blame] | 144 | // Inserts a wait on fence command into the Vulkan command buffer. |
| 145 | status_t fenceWait(sp<Fence>& fence); |
| 146 | |
| 147 | // Creates a fence that is signaled, when all the pending Vulkan commands are flushed. |
| 148 | status_t createReleaseFence(sp<Fence>& nativeFence); |
| 149 | |
Bo Liu | 7b8c1eb | 2019-01-08 20:17:55 -0800 | [diff] [blame] | 150 | // Returned pointers are owned by VulkanManager. |
| 151 | VkFunctorInitParams getVkFunctorInitParams() const; |
| 152 | |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 153 | sk_sp<GrContext> createContext(GrContextOptions options); |
| 154 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 155 | private: |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 156 | // Sets up the VkInstance and VkDevice objects. Also fills out the passed in |
| 157 | // VkPhysicalDeviceFeatures struct. |
Stan Iliev | 90276c8 | 2019-02-03 18:01:02 -0500 | [diff] [blame] | 158 | void setupDevice(GrVkExtensions&, VkPhysicalDeviceFeatures2&); |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 159 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 160 | void destroyBuffers(VulkanSurface* surface); |
| 161 | |
| 162 | bool createSwapchain(VulkanSurface* surface); |
| 163 | void createBuffers(VulkanSurface* surface, VkFormat format, VkExtent2D extent); |
| 164 | |
| 165 | VulkanSurface::BackbufferInfo* getAvailableBackbuffer(VulkanSurface* surface); |
| 166 | |
Greg Daniel | 26e0dca | 2018-09-18 10:33:19 -0400 | [diff] [blame] | 167 | bool setupDummyCommandBuffer(); |
| 168 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 169 | // simple wrapper class that exists only to initialize a pointer to NULL |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 170 | template <typename FNPTR_TYPE> |
| 171 | class VkPtr { |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 172 | public: |
| 173 | VkPtr() : fPtr(NULL) {} |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 174 | VkPtr operator=(FNPTR_TYPE ptr) { |
| 175 | fPtr = ptr; |
| 176 | return *this; |
| 177 | } |
Chih-Hung Hsieh | d736d4b | 2018-12-20 13:55:20 -0800 | [diff] [blame] | 178 | // NOLINTNEXTLINE(google-explicit-constructor) |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 179 | operator FNPTR_TYPE() const { return fPtr; } |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 180 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 181 | private: |
| 182 | FNPTR_TYPE fPtr; |
| 183 | }; |
| 184 | |
| 185 | // WSI interface functions |
| 186 | VkPtr<PFN_vkCreateAndroidSurfaceKHR> mCreateAndroidSurfaceKHR; |
| 187 | VkPtr<PFN_vkDestroySurfaceKHR> mDestroySurfaceKHR; |
| 188 | VkPtr<PFN_vkGetPhysicalDeviceSurfaceSupportKHR> mGetPhysicalDeviceSurfaceSupportKHR; |
| 189 | VkPtr<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR> mGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 190 | VkPtr<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR> mGetPhysicalDeviceSurfaceFormatsKHR; |
| 191 | VkPtr<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR> mGetPhysicalDeviceSurfacePresentModesKHR; |
| 192 | |
| 193 | VkPtr<PFN_vkCreateSwapchainKHR> mCreateSwapchainKHR; |
| 194 | VkPtr<PFN_vkDestroySwapchainKHR> mDestroySwapchainKHR; |
| 195 | VkPtr<PFN_vkGetSwapchainImagesKHR> mGetSwapchainImagesKHR; |
| 196 | VkPtr<PFN_vkAcquireNextImageKHR> mAcquireNextImageKHR; |
| 197 | VkPtr<PFN_vkQueuePresentKHR> mQueuePresentKHR; |
| 198 | VkPtr<PFN_vkCreateSharedSwapchainsKHR> mCreateSharedSwapchainsKHR; |
| 199 | |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 200 | // Instance Functions |
Greg Daniel | a227dbb | 2018-08-20 09:19:48 -0400 | [diff] [blame] | 201 | VkPtr<PFN_vkEnumerateInstanceVersion> mEnumerateInstanceVersion; |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 202 | VkPtr<PFN_vkEnumerateInstanceExtensionProperties> mEnumerateInstanceExtensionProperties; |
| 203 | VkPtr<PFN_vkCreateInstance> mCreateInstance; |
| 204 | |
| 205 | VkPtr<PFN_vkDestroyInstance> mDestroyInstance; |
| 206 | VkPtr<PFN_vkEnumeratePhysicalDevices> mEnumeratePhysicalDevices; |
Greg Daniel | 9625962 | 2018-10-01 14:42:56 -0400 | [diff] [blame] | 207 | VkPtr<PFN_vkGetPhysicalDeviceProperties> mGetPhysicalDeviceProperties; |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 208 | VkPtr<PFN_vkGetPhysicalDeviceQueueFamilyProperties> mGetPhysicalDeviceQueueFamilyProperties; |
Greg Daniel | a227dbb | 2018-08-20 09:19:48 -0400 | [diff] [blame] | 209 | VkPtr<PFN_vkGetPhysicalDeviceFeatures2> mGetPhysicalDeviceFeatures2; |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 210 | VkPtr<PFN_vkCreateDevice> mCreateDevice; |
| 211 | VkPtr<PFN_vkEnumerateDeviceExtensionProperties> mEnumerateDeviceExtensionProperties; |
| 212 | |
| 213 | // Device Functions |
| 214 | VkPtr<PFN_vkGetDeviceQueue> mGetDeviceQueue; |
| 215 | VkPtr<PFN_vkDeviceWaitIdle> mDeviceWaitIdle; |
| 216 | VkPtr<PFN_vkDestroyDevice> mDestroyDevice; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 217 | VkPtr<PFN_vkCreateCommandPool> mCreateCommandPool; |
| 218 | VkPtr<PFN_vkDestroyCommandPool> mDestroyCommandPool; |
| 219 | VkPtr<PFN_vkAllocateCommandBuffers> mAllocateCommandBuffers; |
| 220 | VkPtr<PFN_vkFreeCommandBuffers> mFreeCommandBuffers; |
| 221 | VkPtr<PFN_vkResetCommandBuffer> mResetCommandBuffer; |
| 222 | VkPtr<PFN_vkBeginCommandBuffer> mBeginCommandBuffer; |
| 223 | VkPtr<PFN_vkEndCommandBuffer> mEndCommandBuffer; |
| 224 | VkPtr<PFN_vkCmdPipelineBarrier> mCmdPipelineBarrier; |
| 225 | |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 226 | VkPtr<PFN_vkQueueSubmit> mQueueSubmit; |
| 227 | VkPtr<PFN_vkQueueWaitIdle> mQueueWaitIdle; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 228 | |
| 229 | VkPtr<PFN_vkCreateSemaphore> mCreateSemaphore; |
| 230 | VkPtr<PFN_vkDestroySemaphore> mDestroySemaphore; |
Greg Daniel | 26e0dca | 2018-09-18 10:33:19 -0400 | [diff] [blame] | 231 | VkPtr<PFN_vkImportSemaphoreFdKHR> mImportSemaphoreFdKHR; |
| 232 | VkPtr<PFN_vkGetSemaphoreFdKHR> mGetSemaphoreFdKHR; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 233 | VkPtr<PFN_vkCreateFence> mCreateFence; |
| 234 | VkPtr<PFN_vkDestroyFence> mDestroyFence; |
| 235 | VkPtr<PFN_vkWaitForFences> mWaitForFences; |
| 236 | VkPtr<PFN_vkResetFences> mResetFences; |
| 237 | |
Greg Daniel | 2ff20271 | 2018-06-14 11:50:10 -0400 | [diff] [blame] | 238 | VkInstance mInstance = VK_NULL_HANDLE; |
| 239 | VkPhysicalDevice mPhysicalDevice = VK_NULL_HANDLE; |
| 240 | VkDevice mDevice = VK_NULL_HANDLE; |
| 241 | |
| 242 | uint32_t mGraphicsQueueIndex; |
| 243 | VkQueue mGraphicsQueue = VK_NULL_HANDLE; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 244 | uint32_t mPresentQueueIndex; |
| 245 | VkQueue mPresentQueue = VK_NULL_HANDLE; |
| 246 | VkCommandPool mCommandPool = VK_NULL_HANDLE; |
Greg Daniel | cd55852 | 2016-11-17 13:31:40 -0500 | [diff] [blame] | 247 | |
Greg Daniel | 26e0dca | 2018-09-18 10:33:19 -0400 | [diff] [blame] | 248 | VkCommandBuffer mDummyCB = VK_NULL_HANDLE; |
| 249 | |
Bo Liu | 7b8c1eb | 2019-01-08 20:17:55 -0800 | [diff] [blame] | 250 | // Variables saved to populate VkFunctorInitParams. |
Greg Daniel | eaf310e | 2019-01-28 16:10:32 -0500 | [diff] [blame] | 251 | static const uint32_t mAPIVersion = VK_MAKE_VERSION(1, 1, 0); |
Bo Liu | 7b8c1eb | 2019-01-08 20:17:55 -0800 | [diff] [blame] | 252 | std::vector<const char*> mInstanceExtensions; |
| 253 | std::vector<const char*> mDeviceExtensions; |
| 254 | VkPhysicalDeviceFeatures2 mPhysicalDeviceFeatures2{}; |
| 255 | |
Greg Daniel | cd55852 | 2016-11-17 13:31:40 -0500 | [diff] [blame] | 256 | enum class SwapBehavior { |
| 257 | Discard, |
| 258 | BufferAge, |
| 259 | }; |
| 260 | SwapBehavior mSwapBehavior = SwapBehavior::Discard; |
Stan Iliev | 981afe7 | 2019-02-13 14:24:33 -0500 | [diff] [blame] | 261 | GrVkExtensions mExtensions; |
Derek Sollenberger | 0e3cba3 | 2016-11-09 11:58:36 -0500 | [diff] [blame] | 262 | }; |
| 263 | |
| 264 | } /* namespace renderthread */ |
| 265 | } /* namespace uirenderer */ |
| 266 | } /* namespace android */ |
| 267 | |
| 268 | #endif /* VULKANMANAGER_H */ |