SF: Refactor Layer::prepareClientCompositionList
Replace Layer::prepareClientCompositionList with
Layer::prepareClientComposition now that at most one layer is returned
for any call. Also changes OutputLayer::getOverrideCompositionList to
return an optional for the same reason.
Output::generateClientCompositionRequest is updated to use buffer ids
instead of strong pointers to buffers when determining whether or not
override settings are redundant. This is done to avoid duplicate checks
on whether or not overrideInfo has a non-null buffer.
Change-Id: I777f6ba8c3ca38ea31773e6fcbacb65fad287b03
Bug: b/188891810
Test: atest libcompositionengine_test
diff --git a/services/surfaceflinger/BufferStateLayer.h b/services/surfaceflinger/BufferStateLayer.h
index 8bad3d2..a0f13e2 100644
--- a/services/surfaceflinger/BufferStateLayer.h
+++ b/services/surfaceflinger/BufferStateLayer.h
@@ -159,6 +159,9 @@
std::atomic<int32_t>* getPendingBufferCounter() override { return &mPendingBufferTransactions; }
std::string getPendingBufferCounterName() override { return mBlastTransactionName; }
+ std::optional<compositionengine::LayerFE::LayerSettings> prepareClientComposition(
+ compositionengine::LayerFE::ClientCompositionTargetSettings&) const override;
+
protected:
void gatherBufferInfo();
void onSurfaceFrameCreated(const std::shared_ptr<frametimeline::SurfaceFrame>& surfaceFrame);
@@ -188,9 +191,6 @@
BufferInfo mBufferInfo;
- std::optional<compositionengine::LayerFE::LayerSettings> prepareClientComposition(
- compositionengine::LayerFE::ClientCompositionTargetSettings&) override;
-
/*
* compositionengine::LayerFE overrides
*/
@@ -236,7 +236,7 @@
// Computes the transform matrix using the setFilteringEnabled to determine whether the
// transform matrix should be computed for use with bilinear filtering.
- void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]);
+ void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]) const;
std::unique_ptr<compositionengine::LayerFECompositionState> mCompositionState;
@@ -270,6 +270,9 @@
const sp<Fence>& releaseFence,
uint32_t currentMaxAcquiredBufferCount);
+ std::optional<compositionengine::LayerFE::LayerSettings> prepareClientCompositionInternal(
+ compositionengine::LayerFE::ClientCompositionTargetSettings&) const;
+
ReleaseCallbackId mPreviousReleaseCallbackId = ReleaseCallbackId::INVALID_ID;
uint64_t mPreviousReleasedFrameNumber = 0;