summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/BufferStateLayer.cpp
diff options
context:
space:
mode:
author Dominik Laskowski <domlaskowski@google.com> 2022-05-09 09:36:19 -0700
committer Dominik Laskowski <domlaskowski@google.com> 2022-05-16 08:13:29 -0700
commitb17c62120b646f378c0b842b3d7fcce8a5540e3e (patch)
tree13f01098a51f9c387d3e8c87683f55ef40de4ba4 /services/surfaceflinger/BufferStateLayer.cpp
parentbb448ce9aa521f9574d94c9ec2d57eb7d37382cb (diff)
FTL: Yield futures without overhead
ftl::yield, which lifts T to std::future<T>, incurs the cost of allocating, ref counting, and locking the latter's shared state. Consolidate the existing std::future extensions into ftl::Future, and optimize ftl::yield by including static storage for T within. Bug: 232436803 Test: simpleperf (-31% cycles in postFramebuffer) Change-Id: I9a7ca7de17e7af10515de97d2f6a0dfa24e35d7a
Diffstat (limited to 'services/surfaceflinger/BufferStateLayer.cpp')
-rw-r--r--services/surfaceflinger/BufferStateLayer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp
index c88511049b..b424a4ae3a 100644
--- a/services/surfaceflinger/BufferStateLayer.cpp
+++ b/services/surfaceflinger/BufferStateLayer.cpp
@@ -73,7 +73,7 @@ BufferStateLayer::~BufferStateLayer() {
// -----------------------------------------------------------------------
// Interface implementation for Layer
// -----------------------------------------------------------------------
-void BufferStateLayer::onLayerDisplayed(std::shared_future<FenceResult> futureFenceResult) {
+void BufferStateLayer::onLayerDisplayed(ftl::SharedFuture<FenceResult> futureFenceResult) {
// If we are displayed on multiple displays in a single composition cycle then we would
// need to do careful tracking to enable the use of the mLastClientCompositionFence.
// For example we can only use it if all the displays are client comp, and we need