diff options
author | Bill Peckham <bpeckham@google.com> | 2018-10-09 17:33:34 -0700 |
---|---|---|
committer | Bill Peckham <bpeckham@google.com> | 2018-10-15 17:46:00 -0700 |
commit | ddcaa93e851eb5e57692799446f2ef3fe31436ae (patch) | |
tree | 41f5481541b8c4e26dd8fef5cbba7a24aa1003c7 /libs/hwui/renderthread/VulkanManager.h | |
parent | 760f366150e46580bfa808a897bc99c3e8907ded (diff) | |
parent | ef229d9195a2bdff34f94420687c0c05f4447a88 (diff) |
Merge QP1A.181008.001
Change-Id: Iff68e8d0501ac5c2998c96f9df4042a94a1ce9e1
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.h')
-rw-r--r-- | libs/hwui/renderthread/VulkanManager.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h index 7a539ae42605..6702649402e6 100644 --- a/libs/hwui/renderthread/VulkanManager.h +++ b/libs/hwui/renderthread/VulkanManager.h @@ -26,6 +26,7 @@ #include <ui/Fence.h> #include <utils/StrongPointer.h> #include <vk/GrVkBackendContext.h> +#include "IRenderPipeline.h" class GrVkExtensions; @@ -37,7 +38,7 @@ class RenderThread; class VulkanSurface { public: - VulkanSurface() {} + VulkanSurface(ColorMode colorMode) : mColorMode(colorMode) {} sk_sp<SkSurface> getBackBufferSurface() { return mBackbuffer; } @@ -73,6 +74,7 @@ private: VkImage* mImages = nullptr; ImageInfo* mImageInfos; uint16_t mCurrentTime = 0; + ColorMode mColorMode; }; // This class contains the shared global Vulkan objects, such as VkInstance, VkDevice and VkQueue, @@ -90,7 +92,7 @@ public: // Given a window this creates a new VkSurfaceKHR and VkSwapchain and stores them inside a new // VulkanSurface object which is returned. - VulkanSurface* createSurface(ANativeWindow* window); + VulkanSurface* createSurface(ANativeWindow* window, ColorMode colorMode); // Destroy the VulkanSurface and all associated vulkan objects. void destroySurface(VulkanSurface* surface); @@ -118,10 +120,6 @@ public: // Creates a fence that is signaled, when all the pending Vulkan commands are flushed. status_t createReleaseFence(sp<Fence>& nativeFence); - // TODO(b/115636873): Handle composition preference. - SkColorType getSurfaceColorType() const { return SkColorType::kN32_SkColorType; } - sk_sp<SkColorSpace> getSurfaceColorSpace() { return SkColorSpace::MakeSRGB(); } - private: friend class RenderThread; @@ -139,6 +137,8 @@ private: VulkanSurface::BackbufferInfo* getAvailableBackbuffer(VulkanSurface* surface); + bool setupDummyCommandBuffer(); + // simple wrapper class that exists only to initialize a pointer to NULL template <typename FNPTR_TYPE> class VkPtr { @@ -176,6 +176,7 @@ private: VkPtr<PFN_vkDestroyInstance> mDestroyInstance; VkPtr<PFN_vkEnumeratePhysicalDevices> mEnumeratePhysicalDevices; + VkPtr<PFN_vkGetPhysicalDeviceProperties> mGetPhysicalDeviceProperties; VkPtr<PFN_vkGetPhysicalDeviceQueueFamilyProperties> mGetPhysicalDeviceQueueFamilyProperties; VkPtr<PFN_vkGetPhysicalDeviceFeatures2> mGetPhysicalDeviceFeatures2; VkPtr<PFN_vkCreateDevice> mCreateDevice; @@ -199,6 +200,8 @@ private: VkPtr<PFN_vkCreateSemaphore> mCreateSemaphore; VkPtr<PFN_vkDestroySemaphore> mDestroySemaphore; + VkPtr<PFN_vkImportSemaphoreFdKHR> mImportSemaphoreFdKHR; + VkPtr<PFN_vkGetSemaphoreFdKHR> mGetSemaphoreFdKHR; VkPtr<PFN_vkCreateFence> mCreateFence; VkPtr<PFN_vkDestroyFence> mDestroyFence; VkPtr<PFN_vkWaitForFences> mWaitForFences; @@ -216,6 +219,8 @@ private: VkQueue mPresentQueue = VK_NULL_HANDLE; VkCommandPool mCommandPool = VK_NULL_HANDLE; + VkCommandBuffer mDummyCB = VK_NULL_HANDLE; + enum class SwapBehavior { Discard, BufferAge, |