Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a746e911 authored by John Reck's avatar John Reck Committed by Automerger Merge Worker
Browse files

Merge "Invalidate buffers on transform change" into udc-dev am: 700384f2 am: 622bbeca

parents bcd14956 622bbeca
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -375,6 +375,14 @@ void VulkanSurface::releaseBuffers() {
    }
}

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.
@@ -407,6 +415,10 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() {
            // 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) {
+1 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ private:
                                           WindowInfo* outWindowInfo);
    static bool UpdateWindow(ANativeWindow* window, const WindowInfo& windowInfo);
    void releaseBuffers();
    void invalidateBuffers();

    // TODO: This number comes from ui/BufferQueueDefs. We're not pulling the
    // header in so that we don't need to depend on libui, but we should share