Loading services/surfaceflinger/DisplayHardware/ComposerHal.cpp +30 −0 Original line number Diff line number Diff line Loading @@ -1324,6 +1324,36 @@ V2_4::Error Composer::setContentType(Display display, IComposerClient::ContentTy return mClient_2_4->setContentType(display, contentType); } V2_4::Error Composer::setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) { using Error = V2_4::Error; if (!mClient_2_4) { return Error::UNSUPPORTED; } mWriter.selectDisplay(display); mWriter.selectLayer(layer); mWriter.setLayerGenericMetadata(key, mandatory, value); return Error::NONE; } V2_4::Error Composer::getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) { using Error = V2_4::Error; if (!mClient_2_4) { return Error::UNSUPPORTED; } Error error = kDefaultError_2_4; mClient_2_4->getLayerGenericMetadataKeys([&](const auto& tmpError, const auto& tmpKeys) { error = tmpError; if (error != Error::NONE) { return; } *outKeys = tmpKeys; }); return error; } CommandReader::~CommandReader() { resetData(); Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +9 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,11 @@ public: std::vector<IComposerClient::ContentType>* outSupportedContentTypes) = 0; virtual V2_4::Error setContentType(Display displayId, IComposerClient::ContentType contentType) = 0; virtual V2_4::Error setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) = 0; virtual V2_4::Error getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) = 0; }; namespace impl { Loading Loading @@ -463,6 +468,10 @@ public: std::vector<IComposerClient::ContentType>* outSupportedContentTypes) override; V2_4::Error setContentType(Display displayId, IComposerClient::ContentType contentType) override; V2_4::Error setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) override; V2_4::Error getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) override; private: #if defined(USE_VR_COMPOSER) && USE_VR_COMPOSER Loading services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -789,6 +789,18 @@ V2_4::Error FakeComposerClient::validateDisplay_2_4( return V2_4::Error::NONE; } V2_4::Error FakeComposerClient::setLayerGenericMetadata(Display, Layer, const std::string&, bool, const std::vector<uint8_t>&) { ALOGV("setLayerGenericMetadata"); return V2_4::Error::UNSUPPORTED; } V2_4::Error FakeComposerClient::getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>*) { ALOGV("getLayerGenericMetadataKeys"); return V2_4::Error::UNSUPPORTED; } ////////////////////////////////////////////////////////////////// void FakeComposerClient::requestVSync(uint64_t vsyncTime) { Loading services/surfaceflinger/tests/fakehwc/FakeComposerClient.h +4 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ public: uint32_t* outDisplayRequestMask, std::vector<Layer>* outRequestedLayers, std::vector<uint32_t>* outRequestMasks, IComposerClient::ClientTargetProperty* outClientTargetProperty) override; V2_4::Error setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) override; V2_4::Error getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) override; void setClient(ComposerClient* client); Loading services/surfaceflinger/tests/unittests/mock/DisplayHardware/MockComposer.h +5 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,11 @@ public: MOCK_METHOD2(getSupportedContentTypes, V2_4::Error(Display, std::vector<IComposerClient::ContentType>*)); MOCK_METHOD2(setContentType, V2_4::Error(Display, IComposerClient::ContentType)); MOCK_METHOD5(setLayerGenericMetadata, V2_4::Error(Display, Layer, const std::string&, bool, const std::vector<uint8_t>&)); MOCK_METHOD1(getLayerGenericMetadataKeys, V2_4::Error(std::vector<IComposerClient::LayerGenericMetadataKey>*)); }; } // namespace mock Loading Loading
services/surfaceflinger/DisplayHardware/ComposerHal.cpp +30 −0 Original line number Diff line number Diff line Loading @@ -1324,6 +1324,36 @@ V2_4::Error Composer::setContentType(Display display, IComposerClient::ContentTy return mClient_2_4->setContentType(display, contentType); } V2_4::Error Composer::setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) { using Error = V2_4::Error; if (!mClient_2_4) { return Error::UNSUPPORTED; } mWriter.selectDisplay(display); mWriter.selectLayer(layer); mWriter.setLayerGenericMetadata(key, mandatory, value); return Error::NONE; } V2_4::Error Composer::getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) { using Error = V2_4::Error; if (!mClient_2_4) { return Error::UNSUPPORTED; } Error error = kDefaultError_2_4; mClient_2_4->getLayerGenericMetadataKeys([&](const auto& tmpError, const auto& tmpKeys) { error = tmpError; if (error != Error::NONE) { return; } *outKeys = tmpKeys; }); return error; } CommandReader::~CommandReader() { resetData(); Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +9 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,11 @@ public: std::vector<IComposerClient::ContentType>* outSupportedContentTypes) = 0; virtual V2_4::Error setContentType(Display displayId, IComposerClient::ContentType contentType) = 0; virtual V2_4::Error setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) = 0; virtual V2_4::Error getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) = 0; }; namespace impl { Loading Loading @@ -463,6 +468,10 @@ public: std::vector<IComposerClient::ContentType>* outSupportedContentTypes) override; V2_4::Error setContentType(Display displayId, IComposerClient::ContentType contentType) override; V2_4::Error setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) override; V2_4::Error getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) override; private: #if defined(USE_VR_COMPOSER) && USE_VR_COMPOSER Loading
services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -789,6 +789,18 @@ V2_4::Error FakeComposerClient::validateDisplay_2_4( return V2_4::Error::NONE; } V2_4::Error FakeComposerClient::setLayerGenericMetadata(Display, Layer, const std::string&, bool, const std::vector<uint8_t>&) { ALOGV("setLayerGenericMetadata"); return V2_4::Error::UNSUPPORTED; } V2_4::Error FakeComposerClient::getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>*) { ALOGV("getLayerGenericMetadataKeys"); return V2_4::Error::UNSUPPORTED; } ////////////////////////////////////////////////////////////////// void FakeComposerClient::requestVSync(uint64_t vsyncTime) { Loading
services/surfaceflinger/tests/fakehwc/FakeComposerClient.h +4 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ public: uint32_t* outDisplayRequestMask, std::vector<Layer>* outRequestedLayers, std::vector<uint32_t>* outRequestMasks, IComposerClient::ClientTargetProperty* outClientTargetProperty) override; V2_4::Error setLayerGenericMetadata(Display display, Layer layer, const std::string& key, bool mandatory, const std::vector<uint8_t>& value) override; V2_4::Error getLayerGenericMetadataKeys( std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) override; void setClient(ComposerClient* client); Loading
services/surfaceflinger/tests/unittests/mock/DisplayHardware/MockComposer.h +5 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,11 @@ public: MOCK_METHOD2(getSupportedContentTypes, V2_4::Error(Display, std::vector<IComposerClient::ContentType>*)); MOCK_METHOD2(setContentType, V2_4::Error(Display, IComposerClient::ContentType)); MOCK_METHOD5(setLayerGenericMetadata, V2_4::Error(Display, Layer, const std::string&, bool, const std::vector<uint8_t>&)); MOCK_METHOD1(getLayerGenericMetadataKeys, V2_4::Error(std::vector<IComposerClient::LayerGenericMetadataKey>*)); }; } // namespace mock Loading