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

Commit 59f6d2df authored by Vishnu Nair's avatar Vishnu Nair
Browse files

SF: Add TransactionHandler

- migrate transaction queueing and flushing into
  a new class and remove dependencies from
  other components.
- Add a filter interface for other components to
  participate in transactionready logic.

Test: presubmit
Bug: 238781169
Change-Id: Ia4da386cd72058126f6f765adafb9cb4d15b1d2b
parent 1523dad8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -634,7 +634,7 @@ bool layer_state_t::hasBufferChanges() const {
}
}


bool layer_state_t::hasValidBuffer() const {
bool layer_state_t::hasValidBuffer() const {
    return bufferData && (bufferData->buffer || bufferData->cachedBuffer.isValid());
    return bufferData && (bufferData->hasBuffer() || bufferData->cachedBuffer.isValid());
}
}


status_t layer_state_t::matrix22_t::write(Parcel& output) const {
status_t layer_state_t::matrix22_t::write(Parcel& output) const {
+51 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <gui/LayerState.h>

namespace android::fake {

// Class which exposes buffer properties from BufferData without holding on to an actual buffer
class BufferData : public android::BufferData {
public:
    BufferData(uint64_t bufferId, uint32_t width, uint32_t height, int32_t pixelFormat,
               uint64_t outUsage)
          : mBufferId(bufferId),
            mWidth(width),
            mHeight(height),
            mPixelFormat(pixelFormat),
            mOutUsage(outUsage) {}
    bool hasBuffer() const override { return mBufferId != 0; }
    bool hasSameBuffer(const android::BufferData& other) const override {
        return getId() == other.getId() && frameNumber == other.frameNumber;
    }
    uint32_t getWidth() const override { return mWidth; }
    uint32_t getHeight() const override { return mHeight; }
    uint64_t getId() const override { return mBufferId; }
    PixelFormat getPixelFormat() const override { return mPixelFormat; }
    uint64_t getUsage() const override { return mOutUsage; }

private:
    uint64_t mBufferId;
    uint32_t mWidth;
    uint32_t mHeight;
    int32_t mPixelFormat;
    uint64_t mOutUsage;
};

} // namespace android::fake
+1 −0
Original line number Original line Diff line number Diff line
@@ -194,6 +194,7 @@ filegroup {
        "Tracing/TransactionTracing.cpp",
        "Tracing/TransactionTracing.cpp",
        "Tracing/TransactionProtoParser.cpp",
        "Tracing/TransactionProtoParser.cpp",
        "TransactionCallbackInvoker.cpp",
        "TransactionCallbackInvoker.cpp",
        "TransactionHandler.cpp",
        "TunnelModeEnabledReporter.cpp",
        "TunnelModeEnabledReporter.cpp",
    ],
    ],
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -881,7 +881,9 @@ public:


    bool mPendingHWCDestroy{false};
    bool mPendingHWCDestroy{false};


    bool backpressureEnabled() { return mDrawingState.flags & layer_state_t::eEnableBackpressure; }
    bool backpressureEnabled() const {
        return mDrawingState.flags & layer_state_t::eEnableBackpressure;
    }


    bool setStretchEffect(const StretchEffect& effect);
    bool setStretchEffect(const StretchEffect& effect);
    StretchEffect getStretchEffect() const;
    StretchEffect getStretchEffect() const;
+112 −220

File changed.

Preview size limit exceeded, changes collapsed.

Loading