diff options
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.h')
-rw-r--r-- | libs/hwui/renderthread/VulkanManager.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h index 9eb942c9d6ee..b06eb82dac79 100644 --- a/libs/hwui/renderthread/VulkanManager.h +++ b/libs/hwui/renderthread/VulkanManager.h @@ -45,6 +45,14 @@ public: sk_sp<SkSurface> getBackBufferSurface() { return mBackbuffer; } + // The width and height are are the logical width and height for when submitting draws to the + // surface. In reality if the window is rotated the underlying VkImage may have the width and + // height swapped. + int windowWidth() const { return mWindowWidth; } + int windowHeight() const { return mWindowHeight; } + + SkMatrix& preTransform() { return mPreTransform; } + private: friend class VulkanManager; struct BackbufferInfo { @@ -84,6 +92,8 @@ private: sk_sp<SkColorSpace> mColorSpace; SkColorSpace::Gamut mColorGamut; SkColorType mColorType; + VkSurfaceTransformFlagBitsKHR mTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; + SkMatrix mPreTransform; }; // This class contains the shared global Vulkan objects, such as VkInstance, VkDevice and VkQueue, @@ -132,6 +142,9 @@ public: // Creates a fence that is signaled, when all the pending Vulkan commands are flushed. status_t createReleaseFence(sp<Fence>& nativeFence); + // Returned pointers are owned by VulkanManager. + VkFunctorInitParams getVkFunctorInitParams() const; + private: friend class RenderThread; @@ -234,6 +247,12 @@ private: VkCommandBuffer mDummyCB = VK_NULL_HANDLE; + // Variables saved to populate VkFunctorInitParams. + uint32_t mInstanceVersion = 0u; + std::vector<const char*> mInstanceExtensions; + std::vector<const char*> mDeviceExtensions; + VkPhysicalDeviceFeatures2 mPhysicalDeviceFeatures2{}; + enum class SwapBehavior { Discard, BufferAge, |