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

Commit 0e453a75 authored by Huihong Luo's avatar Huihong Luo Committed by Automerger Merge Worker
Browse files

Merge "Reset pending commands" into udc-dev am: b7ffedf7 am: 505988d8

parents 57848f80 505988d8
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -70,12 +70,6 @@ class ComposerClientWriter final {
    ComposerClientWriter(const ComposerClientWriter&) = delete;
    ComposerClientWriter& operator=(const ComposerClientWriter&) = delete;

    void reset() {
        mDisplayCommand.reset();
        mLayerCommand.reset();
        mCommands.clear();
    }

    void setColorTransform(int64_t display, const float* matrix) {
        std::vector<float> matVec;
        matVec.reserve(16);
@@ -235,10 +229,12 @@ class ComposerClientWriter final {
        getLayerCommand(display, layer).blockingRegion.emplace(blocking.begin(), blocking.end());
    }

    const std::vector<DisplayCommand>& getPendingCommands() {
    std::vector<DisplayCommand> takePendingCommands() {
        flushLayerCommand();
        flushDisplayCommand();
        return mCommands;
        std::vector<DisplayCommand> moved = std::move(mCommands);
        mCommands.clear();
        return moved;
    }

  private:
@@ -289,6 +285,12 @@ class ComposerClientWriter final {
        }
        return *mLayerCommand;
    }

    void reset() {
        mDisplayCommand.reset();
        mLayerCommand.reset();
        mCommands.clear();
    }
};

}  // namespace aidl::android::hardware::graphics::composer3
+1 −3
Original line number Diff line number Diff line
@@ -207,9 +207,8 @@ class GraphicsCompositionTestBase : public ::testing::Test {
    }

    void execute() {
        const auto& commands = mWriter->getPendingCommands();
        auto commands = mWriter->takePendingCommands();
        if (commands.empty()) {
            mWriter->reset();
            return;
        }

@@ -217,7 +216,6 @@ class GraphicsCompositionTestBase : public ::testing::Test {
        ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();

        mReader.parse(std::move(results));
        mWriter->reset();
    }

    bool getHasReadbackBuffer() {
+1 −3
Original line number Diff line number Diff line
@@ -1171,15 +1171,13 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
    void execute() {
        std::vector<CommandResultPayload> payloads;
        for (auto& [_, writer] : mWriters) {
            const auto& commands = writer.getPendingCommands();
            auto commands = writer.takePendingCommands();
            if (commands.empty()) {
                writer.reset();
                continue;
            }

            auto [status, results] = mComposerClient->executeCommands(commands);
            ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
            writer.reset();

            payloads.reserve(payloads.size() + results.size());
            payloads.insert(payloads.end(), std::make_move_iterator(results.begin()),