File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,6 +368,14 @@ void VulkanSurface::releaseBuffers() {
368368 }
369369}
370370
371+ void VulkanSurface::invalidateBuffers () {
372+ for (uint32_t i = 0 ; i < mWindowInfo .bufferCount ; i++) {
373+ VulkanSurface::NativeBufferInfo& bufferInfo = mNativeBuffers [i];
374+ bufferInfo.hasValidContents = false ;
375+ bufferInfo.lastPresentedCount = 0 ;
376+ }
377+ }
378+
371379VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer () {
372380 // Set the mCurrentBufferInfo to invalid in case of error and only reset it to the correct
373381 // value at the end of the function if everything dequeued correctly.
@@ -400,6 +408,10 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() {
400408 // new NativeBufferInfo storage will be populated lazily as we dequeue each new buffer.
401409 mWindowInfo .actualSize = actualSize;
402410 releaseBuffers ();
411+ } else {
412+ // A change in transform means we need to repaint the entire buffer area as the damage
413+ // rects have just moved about.
414+ invalidateBuffers ();
403415 }
404416
405417 if (transformHint != mWindowInfo .transform ) {
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ class VulkanSurface {
113113 WindowInfo* outWindowInfo);
114114 static bool UpdateWindow (ANativeWindow* window, const WindowInfo& windowInfo);
115115 void releaseBuffers ();
116+ void invalidateBuffers ();
116117
117118 // TODO: This number comes from ui/BufferQueueDefs. We're not pulling the
118119 // header in so that we don't need to depend on libui, but we should share
You can’t perform that action at this time.
0 commit comments