From 02da997fab0d9d50217e4fecdf981d9f8c45d71c Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Fri, 17 Jan 2020 13:39:08 -0800 Subject: [PATCH] Change RenderEngine::drawLayers to take a vector of LayerSettings pointers Prework for the client composition cache logic which extends LayerSettings. Passing in a set of pointers will reduce the amount of copying needed when passing the LayerSettings to RenderEngine. Bug: 136561771 Test: atest librenderengine_test libcompositionengine_test Test: atest VtsHalGraphicsComposerV2_2TargetTest Test: go/wm-smoke Change-Id: I0581be7762bf56cd7a3aab0511adf95cd6e2df76 --- graphics/composer/2.2/utils/vts/RenderEngineVts.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index e2f267012f..a23d72c949 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -57,7 +57,15 @@ void TestRenderEngine::initGraphicBuffer(uint32_t width, uint32_t height, uint32 void TestRenderEngine::drawLayers() { base::unique_fd bufferFence; base::unique_fd readyFence; - mRenderEngine->drawLayers(mDisplaySettings, mCompositionLayers, + + std::vector compositionLayerPointers; + compositionLayerPointers.reserve(mCompositionLayers.size()); + std::transform(mCompositionLayers.begin(), mCompositionLayers.end(), + std::back_insert_iterator(compositionLayerPointers), + [](renderengine::LayerSettings& settings) -> renderengine::LayerSettings* { + return &settings; + }); + mRenderEngine->drawLayers(mDisplaySettings, compositionLayerPointers, mGraphicBuffer->getNativeBuffer(), true, std::move(bufferFence), &readyFence); int fd = readyFence.release();