summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 2593681b6b..5bba7d312b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -108,6 +108,7 @@ Layer::Layer(const LayerCreationArgs& args)
mCurrentState.api = -1;
mCurrentState.hasColorTransform = false;
mCurrentState.colorSpaceAgnostic = false;
+ mCurrentState.frameRateSelectionPriority = PRIORITY_UNSET;
mCurrentState.metadata = args.metadata;
mCurrentState.shadowRadius = 0.f;
@@ -1120,6 +1121,7 @@ bool Layer::setTransparentRegionHint(const Region& transparent) {
setTransactionFlags(eTransactionNeeded);
return true;
}
+
bool Layer::setFlags(uint8_t flags, uint8_t mask) {
const uint32_t newFlags = (mCurrentState.flags & ~mask) | (flags & mask);
if (mCurrentState.flags == newFlags) return false;
@@ -1176,6 +1178,29 @@ bool Layer::setColorSpaceAgnostic(const bool agnostic) {
return true;
}
+bool Layer::setFrameRateSelectionPriority(int32_t priority) {
+ if (mCurrentState.frameRateSelectionPriority == priority) return false;
+ mCurrentState.frameRateSelectionPriority = priority;
+ mCurrentState.sequence++;
+ mCurrentState.modified = true;
+ setTransactionFlags(eTransactionNeeded);
+ return true;
+}
+
+int32_t Layer::getFrameRateSelectionPriority() const {
+ // Check if layer has priority set.
+ if (mDrawingState.frameRateSelectionPriority != PRIORITY_UNSET) {
+ return mDrawingState.frameRateSelectionPriority;
+ }
+ // If not, search whether its parents have it set.
+ sp<Layer> parent = getParent();
+ if (parent != nullptr) {
+ return parent->getFrameRateSelectionPriority();
+ }
+
+ return Layer::PRIORITY_UNSET;
+}
+
uint32_t Layer::getLayerStack() const {
auto p = mDrawingParent.promote();
if (p == nullptr) {