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/LayerState.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index a7c4f4670a..8b448ff3f6 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -110,6 +110,9 @@ status_t layer_state_t::write(Parcel& output) const } } output.writeFloat(shadowRadius); + + output.writeInt32(frameRateSelectionPriority); + return NO_ERROR; } @@ -188,6 +191,9 @@ status_t layer_state_t::read(const Parcel& input) listeners.emplace_back(listener, callbackIds); } shadowRadius = input.readFloat(); + + frameRateSelectionPriority = input.readInt32(); + return NO_ERROR; } @@ -406,12 +412,14 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eMetadataChanged; metadata.merge(other.metadata); } - if (other.what & eShadowRadiusChanged) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } - + if (other.what & eFrameRateSelectionPriority) { + what |= eFrameRateSelectionPriority; + frameRateSelectionPriority = other.frameRateSelectionPriority; + } if ((other.what & what) != other.what) { ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? " "other.what=0x%" PRIu64 " what=0x%" PRIu64, -- cgit v1.2.3-59-g8ed1b