From c84d09b6464242b1809ffb4f7faa5b2632f4a5e0 Mon Sep 17 00:00:00 2001 From: Ana Krulec Date: Sat, 2 Nov 2019 23:10:29 +0100 Subject: SF Generalization of Refresh Rates: Adding layer priority hint Test: Device boots. Observe logs for errors. Test: Open Swappy and Chrome in split screen, tap between apps, SF prints the correct priority. Test: Open Chrome, play video. SF prints correct priority. Test: SF prints the correct priority received. Bug: 142507166 Change-Id: I5fa8a857c950db01f42a380a72d098039badc289 --- libs/gui/SurfaceComposerClient.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 5e259e258c..2ef33cf253 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -1191,6 +1191,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColor return *this; } +SurfaceComposerClient::Transaction& +SurfaceComposerClient::Transaction::setFrameRateSelectionPriority(const sp& sc, + int32_t priority) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + + s->what |= layer_state_t::eFrameRateSelectionPriority; + s->frameRateSelectionPriority = priority; + + registerSurfaceControlForCallback(sc); + return *this; +} + SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::addTransactionCompletedCallback( TransactionCompletedCallbackTakesContext callback, void* callbackContext) { -- cgit v1.2.3-59-g8ed1b