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

Commit 6e8e3648 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: fix BufferTX counter for null buffers

Don't increment the BufferTX counter is the transaction includes
a buffer change but that buffer is null.

Test: Open  https://jsfiddle.net/8q7nuwh9/show in Chrome and scroll up down
Bug: 192352790
Change-Id: Ia0a27ff32fb20f20a1ac671f2b4fdb3ae22a8aea
parent f0e85668
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -562,6 +562,10 @@ bool layer_state_t::hasBufferChanges() const {
    return (what & layer_state_t::eBufferChanged) || (what & layer_state_t::eCachedBufferChanged);
}

bool layer_state_t::hasValidBuffer() const {
    return buffer || cachedBuffer.isValid();
}

status_t layer_state_t::matrix22_t::write(Parcel& output) const {
    SAFE_PARCEL(output.writeFloat, dsdx);
    SAFE_PARCEL(output.writeFloat, dtdx);
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ struct layer_state_t {
    status_t write(Parcel& output) const;
    status_t read(const Parcel& input);
    bool hasBufferChanges() const;
    bool hasValidBuffer() const;

    struct matrix22_t {
        float dsdx{0};
+1 −1
Original line number Diff line number Diff line
@@ -6858,7 +6858,7 @@ int SurfaceFlinger::getMaxAcquiredBufferCountForRefreshRate(Fps refreshRate) con
void SurfaceFlinger::TransactionState::traverseStatesWithBuffers(
        std::function<void(const layer_state_t&)> visitor) {
    for (const auto& state : states) {
        if (state.state.hasBufferChanges() && (state.state.surface)) {
        if (state.state.hasBufferChanges() && state.state.hasValidBuffer() && state.state.surface) {
            visitor(state.state);
        }
    }