summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.h
diff options
context:
space:
mode:
authorStan Iliev <stani@google.com>2018-11-13 11:14:48 -0500
committerStan Iliev <stani@google.com>2018-11-13 18:44:34 +0000
commit305e13a29390fe00ac6465820cf55938a5415cc4 (patch)
tree61278bfeadbfab8bf409ef07fbe7626e2a004cb2 /libs/hwui/renderthread/VulkanManager.h
parent743ad8a78c8011685f2114b955090045381e153f (diff)
Handle ANativeWindow resize with Vulkan swapchain
Recreate VulkanSurface, if ANativeWindow has been resized. This new code is hit when wallpaper is resized from 64x64 to real size. Bug: 119111018 Test: Wallpaper is shawn correctly with Vulkan rendering Change-Id: I5e43310e5ee8597a7f326d51b1773e2cf68b603a
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.h')
-rw-r--r--libs/hwui/renderthread/VulkanManager.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h
index 6702649402e6..8594a1bd4339 100644
--- a/libs/hwui/renderthread/VulkanManager.h
+++ b/libs/hwui/renderthread/VulkanManager.h
@@ -38,7 +38,8 @@ class RenderThread;
class VulkanSurface {
public:
- VulkanSurface(ColorMode colorMode) : mColorMode(colorMode) {}
+ VulkanSurface(ColorMode colorMode, ANativeWindow* window)
+ : mColorMode(colorMode), mNativeWindow(window) {}
sk_sp<SkSurface> getBackBufferSurface() { return mBackbuffer; }
@@ -75,6 +76,9 @@ private:
ImageInfo* mImageInfos;
uint16_t mCurrentTime = 0;
ColorMode mColorMode;
+ ANativeWindow* mNativeWindow;
+ int mWindowWidth = 0;
+ int mWindowHeight = 0;
};
// This class contains the shared global Vulkan objects, such as VkInstance, VkDevice and VkQueue,
@@ -109,7 +113,7 @@ public:
// Returns an SkSurface which wraps the next image returned from vkAcquireNextImageKHR. It also
// will transition the VkImage from a present layout to color attachment so that it can be used
// by the client for drawing.
- SkSurface* getBackbufferSurface(VulkanSurface* surface);
+ SkSurface* getBackbufferSurface(VulkanSurface** surface);
// Presents the current VkImage.
void swapBuffers(VulkanSurface* surface);