summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Ana Krulec <akrulec@google.com> 2019-11-02 23:10:29 +0100
committer Ana Krulec <akrulec@google.com> 2020-01-15 16:36:19 -0800
commitc84d09b6464242b1809ffb4f7faa5b2632f4a5e0 (patch)
tree2657b5eedbf4251670addfc6576c470675fb57f6 /libs/gui/SurfaceComposerClient.cpp
parentb168232839544cc033bb98e18d3e478afb5ea929 (diff)
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
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp16
1 files changed, 16 insertions, 0 deletions
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
@@ -1192,6 +1192,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColor
}
SurfaceComposerClient::Transaction&
+SurfaceComposerClient::Transaction::setFrameRateSelectionPriority(const sp<SurfaceControl>& 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) {
auto listener = TransactionCompletedListener::getInstance();