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

Commit 056a1528 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't call set_buffer_count for single buffer surfaces" into main

parents ac3c3a4d 1391d8ee
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -322,12 +322,17 @@ bool VulkanSurface::UpdateWindow(ANativeWindow* window, const WindowInfo& window
        return false;
    }

    // If bufferCount == 1 then we're in shared buffer mode and we cannot actually call
    // set_buffer_count, it'll just fail.
    if (windowInfo.bufferCount > 1) {
        err = native_window_set_buffer_count(window, windowInfo.bufferCount);
        if (err != 0) {
        ALOGE("VulkanSurface::UpdateWindow() native_window_set_buffer_count(%zu) failed: %s (%d)",
            ALOGE("VulkanSurface::UpdateWindow() native_window_set_buffer_count(%zu) failed: %s "
                  "(%d)",
                  windowInfo.bufferCount, strerror(-err), err);
            return false;
        }
    }

    err = native_window_set_usage(window, windowInfo.windowUsageFlags);
    if (err != 0) {