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

Commit d67d2443 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

IGBP: Address inconsistent flatten/unflatten for QueueBufferInput

Conversion.cpp uses flatten/unflatten to convert between
::IGraphicBufferProducer::QueueBufferInput and
::hardware::graphics::bufferqueue::V1_0::IGraphicBufferProducer::QueueBufferInput.

But because those 2 classes have different definitions, add the code to
handle them.

Test: libgui_test
Bug: 192439037
Change-Id: Ief0ece787912da981de273da89c9247798f83bf3
parent 2bd3639d
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -1194,7 +1194,8 @@ constexpr size_t minFlattenedSize(
            sizeof(int) +               // scalingMode
            sizeof(uint32_t) +          // transform
            sizeof(uint32_t) +          // stickyTransform
            sizeof(bool); // getFrameTimestamps
            sizeof(bool) +              // getFrameTimestamps
            sizeof(int);                // slot
}

/**
@@ -1267,6 +1268,7 @@ status_t flatten(HGraphicBufferProducer::QueueBufferInput const& t,
        return status;
    }
    FlattenableUtils::write(buffer, size, decltype(HdrMetadata::validTypes)(0));
    FlattenableUtils::write(buffer, size, -1 /*slot*/);
    return NO_ERROR;
}

@@ -1319,7 +1321,7 @@ status_t unflatten(
    if (status != NO_ERROR) {
        return status;
    }
    // HdrMetadata ignored
    // HdrMetadata and slot ignored
    return unflatten(&(t->surfaceDamage), buffer, size);
}