Loading graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h +6 −1 Original line number Diff line number Diff line Loading @@ -403,6 +403,11 @@ class CommandWriterBase { } protected: template <typename T> void beginCommand(T command, uint16_t length) { beginCommandBase(static_cast<IComposerClient::Command>(command), length); } void setClientTargetInternal(uint32_t slot, const native_handle_t* target, int acquireFence, int32_t dataspace, const std::vector<IComposerClient::Rect>& damage) { Loading @@ -429,7 +434,7 @@ class CommandWriterBase { endCommand(); } void beginCommand(IComposerClient::Command command, uint16_t length) { void beginCommandBase(IComposerClient::Command command, uint16_t length) { if (mCommandEnd) { LOG_FATAL("endCommand was not called before command 0x%x", command); } Loading graphics/composer/2.2/utils/command-buffer/include/composer-command-buffer/2.2/ComposerCommandBuffer.h +3 −10 Original line number Diff line number Diff line Loading @@ -76,14 +76,13 @@ class CommandWriterBase : public V2_1::CommandWriterBase { static constexpr uint16_t kSetLayerFloatColorLength = 4; void setLayerFloatColor(IComposerClient::FloatColor color) { beginCommand_2_2(IComposerClient::Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength); beginCommand(IComposerClient::Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength); writeFloatColor(color); endCommand(); } void setLayerPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) { beginCommand_2_2(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, beginCommand(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2); for (const auto& metadata : metadataVec) { writeSigned(static_cast<int32_t>(metadata.key)); Loading @@ -99,12 +98,6 @@ class CommandWriterBase : public V2_1::CommandWriterBase { writeFloat(color.b); 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 Loading graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h +5 −11 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ using android::hardware::graphics::composer::V2_3::IComposerClient; class CommandWriterBase : public V2_2::CommandWriterBase { public: void setLayerPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) { beginCommand_2_3(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, beginCommand(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2); for (const auto& metadata : metadataVec) { writeSigned(static_cast<int32_t>(metadata.key)); Loading @@ -69,7 +69,7 @@ class CommandWriterBase : public V2_2::CommandWriterBase { static constexpr uint16_t kSetLayerColorTransformLength = 16; void setLayerColorTransform(const float* matrix) { beginCommand_2_3(IComposerClient::Command::SET_LAYER_COLOR_TRANSFORM, beginCommand(IComposerClient::Command::SET_LAYER_COLOR_TRANSFORM, kSetLayerColorTransformLength); for (int i = 0; i < 16; i++) { writeFloat(matrix[i]); Loading Loading @@ -109,7 +109,7 @@ class CommandWriterBase : public V2_2::CommandWriterBase { // Blobs are written as: // {numElements, key1, size1, blob1, key2, size2, blob2, key3, size3...} uint16_t length = static_cast<uint16_t>(commandLength); beginCommand_2_3(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length); beginCommand(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length); write(static_cast<uint32_t>(metadata.size())); for (auto metadataBlob : metadata) { writeSigned(static_cast<int32_t>(metadataBlob.key)); Loading @@ -126,12 +126,6 @@ class CommandWriterBase : public V2_2::CommandWriterBase { mDataWritten += numElements; 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 Loading Loading
graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h +6 −1 Original line number Diff line number Diff line Loading @@ -403,6 +403,11 @@ class CommandWriterBase { } protected: template <typename T> void beginCommand(T command, uint16_t length) { beginCommandBase(static_cast<IComposerClient::Command>(command), length); } void setClientTargetInternal(uint32_t slot, const native_handle_t* target, int acquireFence, int32_t dataspace, const std::vector<IComposerClient::Rect>& damage) { Loading @@ -429,7 +434,7 @@ class CommandWriterBase { endCommand(); } void beginCommand(IComposerClient::Command command, uint16_t length) { void beginCommandBase(IComposerClient::Command command, uint16_t length) { if (mCommandEnd) { LOG_FATAL("endCommand was not called before command 0x%x", command); } Loading
graphics/composer/2.2/utils/command-buffer/include/composer-command-buffer/2.2/ComposerCommandBuffer.h +3 −10 Original line number Diff line number Diff line Loading @@ -76,14 +76,13 @@ class CommandWriterBase : public V2_1::CommandWriterBase { static constexpr uint16_t kSetLayerFloatColorLength = 4; void setLayerFloatColor(IComposerClient::FloatColor color) { beginCommand_2_2(IComposerClient::Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength); beginCommand(IComposerClient::Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength); writeFloatColor(color); endCommand(); } void setLayerPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) { beginCommand_2_2(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, beginCommand(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2); for (const auto& metadata : metadataVec) { writeSigned(static_cast<int32_t>(metadata.key)); Loading @@ -99,12 +98,6 @@ class CommandWriterBase : public V2_1::CommandWriterBase { writeFloat(color.b); 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 Loading
graphics/composer/2.3/utils/command-buffer/include/composer-command-buffer/2.3/ComposerCommandBuffer.h +5 −11 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ using android::hardware::graphics::composer::V2_3::IComposerClient; class CommandWriterBase : public V2_2::CommandWriterBase { public: void setLayerPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) { beginCommand_2_3(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, beginCommand(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2); for (const auto& metadata : metadataVec) { writeSigned(static_cast<int32_t>(metadata.key)); Loading @@ -69,7 +69,7 @@ class CommandWriterBase : public V2_2::CommandWriterBase { static constexpr uint16_t kSetLayerColorTransformLength = 16; void setLayerColorTransform(const float* matrix) { beginCommand_2_3(IComposerClient::Command::SET_LAYER_COLOR_TRANSFORM, beginCommand(IComposerClient::Command::SET_LAYER_COLOR_TRANSFORM, kSetLayerColorTransformLength); for (int i = 0; i < 16; i++) { writeFloat(matrix[i]); Loading Loading @@ -109,7 +109,7 @@ class CommandWriterBase : public V2_2::CommandWriterBase { // Blobs are written as: // {numElements, key1, size1, blob1, key2, size2, blob2, key3, size3...} uint16_t length = static_cast<uint16_t>(commandLength); beginCommand_2_3(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length); beginCommand(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length); write(static_cast<uint32_t>(metadata.size())); for (auto metadataBlob : metadata) { writeSigned(static_cast<int32_t>(metadataBlob.key)); Loading @@ -126,12 +126,6 @@ class CommandWriterBase : public V2_2::CommandWriterBase { mDataWritten += numElements; 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 Loading