SF: fix getFrameRateForLayerTree
In commit bdda8f08e38620b071d1c77e8345b141f7fcedfe we removed the
wp<Layer> from LayerHistory and instead updated LayerHistory when
something changed in the Layer itself. That change didn't take into
account that the FrameRateForLayerTree for a layer might change
as a result of a setFrameRate called on a different Layer. In this change
we update the FrameRateForLayerTree for each layer that is impacted
by a setFrameRate call and update LayerHistory accordingly.
Test: atest SetFrameRateTest
Bug: 169873384
Bug: 183225713
Change-Id: Idf044e82225697e6132200dee9cec45b08fe4f5f
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index ad4166b..8139d8a 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -239,8 +239,8 @@
FrameRate frameRate;
- // Indicates whether parents / children of this layer had set FrameRate
- bool treeHasFrameRateVote;
+ // The combined frame rate of parents / children of this layer
+ FrameRate frameRateForLayerTree;
// Set by window manager indicating the layer and all its children are
// in a different orientation than the display. The hint suggests that
@@ -1057,6 +1057,8 @@
// Fills in the frame and transform info for the InputWindowInfo
void fillInputFrameInfo(InputWindowInfo& info, const ui::Transform& toPhysicalDisplay);
+ bool updateFrameRateForLayerTree(bool treeHasFrameRateVote);
+
// Cached properties computed from drawing state
// Effective transform taking into account parent transforms and any parent scaling, which is
// a transform from the current layer coordinate space to display(screen) coordinate space.