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

Commit 8565ad23 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: always preallocate the client composition buffers

We have seen that allocating a GraphicBuffer on the first use
of client composition contributes to jank. To prevent that we
pre-allocate all the needed buffers when we setup the DisplayDevice.

Bug: 191633152
Test: observe logs that pre-allocation happened.
Change-Id: Ia10e023e5c91e6fd94906b90044dd9378d01051c
parent 6b903996
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -2665,9 +2665,7 @@ sp<DisplayDevice> SurfaceFlinger::setupNewDisplayDeviceInternal(


    sp<DisplayDevice> display = getFactory().createDisplayDevice(creationArgs);
    sp<DisplayDevice> display = getFactory().createDisplayDevice(creationArgs);


    if (maxFrameBufferAcquiredBuffers >= 3) {
    nativeWindowSurface->preallocateBuffers();
    nativeWindowSurface->preallocateBuffers();
    }


    ColorMode defaultColorMode = ColorMode::NATIVE;
    ColorMode defaultColorMode = ColorMode::NATIVE;
    Dataspace defaultDataSpace = Dataspace::UNKNOWN;
    Dataspace defaultDataSpace = Dataspace::UNKNOWN;