Invalidate buffers on transform change
Fixes: 271419600
Test: repro steps on bug
Change-Id: Ib4eef40a0f59512c669b069532e55d36293f9e1c
(cherry picked from commit 61c64472417a272ec2aa2fd38e0d1874dbf16319)
Merged-In: Ib4eef40a0f59512c669b069532e55d36293f9e1c
diff --git a/libs/hwui/renderthread/VulkanSurface.cpp b/libs/hwui/renderthread/VulkanSurface.cpp
index 666f329..cbee104 100644
--- a/libs/hwui/renderthread/VulkanSurface.cpp
+++ b/libs/hwui/renderthread/VulkanSurface.cpp
@@ -368,6 +368,14 @@
}
}
+void VulkanSurface::invalidateBuffers() {
+ for (uint32_t i = 0; i < mWindowInfo.bufferCount; i++) {
+ VulkanSurface::NativeBufferInfo& bufferInfo = mNativeBuffers[i];
+ bufferInfo.hasValidContents = false;
+ bufferInfo.lastPresentedCount = 0;
+ }
+}
+
VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() {
// Set the mCurrentBufferInfo to invalid in case of error and only reset it to the correct
// value at the end of the function if everything dequeued correctly.
@@ -400,6 +408,10 @@
// new NativeBufferInfo storage will be populated lazily as we dequeue each new buffer.
mWindowInfo.actualSize = actualSize;
releaseBuffers();
+ } else {
+ // A change in transform means we need to repaint the entire buffer area as the damage
+ // rects have just moved about.
+ invalidateBuffers();
}
if (transformHint != mWindowInfo.transform) {