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

Commit a5aedc32 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

Clean up BeginCommand.

BUG: N/A
Test: build, flash and boot
Change-Id: Ife6132307152e271548a54e11a472751c52d95e4
parent 1b863c2f
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -93,17 +93,18 @@ class CommandWriterBase : public V2_1::CommandWriterBase {
    }
    }


   protected:
   protected:
    void beginCommand_2_2(IComposerClient::Command command, uint16_t length) {
        V2_1::CommandWriterBase::beginCommand(
            static_cast<V2_1::IComposerClient::Command>(static_cast<int32_t>(command)), length);
    }

    void writeFloatColor(const IComposerClient::FloatColor& color) {
    void writeFloatColor(const IComposerClient::FloatColor& color) {
        writeFloat(color.r);
        writeFloat(color.r);
        writeFloat(color.g);
        writeFloat(color.g);
        writeFloat(color.b);
        writeFloat(color.b);
        writeFloat(color.a);
        writeFloat(color.a);
    }
    }

  private:
    void beginCommand_2_2(IComposerClient::Command command, uint16_t length) {
        V2_1::CommandWriterBase::beginCommand(
                static_cast<V2_1::IComposerClient::Command>(static_cast<int32_t>(command)), length);
    }
};
};


// This class helps parse a command queue.  Note that all sizes/lengths are in
// This class helps parse a command queue.  Note that all sizes/lengths are in
+6 −5
Original line number Original line Diff line number Diff line
@@ -119,17 +119,18 @@ class CommandWriterBase : public V2_2::CommandWriterBase {
    }
    }


   protected:
   protected:
    void beginCommand_2_3(IComposerClient::Command command, uint16_t length) {
        V2_2::CommandWriterBase::beginCommand_2_2(
            static_cast<V2_2::IComposerClient::Command>(static_cast<int32_t>(command)), length);
    }

    void writeBlob(uint32_t length, const unsigned char* blob) {
    void writeBlob(uint32_t length, const unsigned char* blob) {
        memcpy(&mData[mDataWritten], blob, length);
        memcpy(&mData[mDataWritten], blob, length);
        uint32_t numElements = length / 4;
        uint32_t numElements = length / 4;
        mDataWritten += numElements;
        mDataWritten += numElements;
        mDataWritten += (length - (numElements * 4) > 0) ? 1 : 0;
        mDataWritten += (length - (numElements * 4) > 0) ? 1 : 0;
    }
    }

  private:
    void beginCommand_2_3(IComposerClient::Command command, uint16_t length) {
        V2_1::CommandWriterBase::beginCommand(
                static_cast<V2_1::IComposerClient::Command>(static_cast<int32_t>(command)), length);
    }
};
};


// This class helps parse a command queue.  Note that all sizes/lengths are in
// This class helps parse a command queue.  Note that all sizes/lengths are in