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
This commit is contained in:
Vishnu Nair 2020-01-17 13:39:08 -08:00
parent 234830afc2
commit 02da997fab

View file

@ -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<const renderengine::LayerSettings*> 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();