summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.h')
-rw-r--r--libs/hwui/renderthread/VulkanManager.h17
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,