Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70f7b69b authored by Rachel Lee's avatar Rachel Lee
Browse files

native: Rename frame rate selection strategies

SELF -> PROPAGATE (default)
DO_NOT_PROPAGATE -> SELF

No behavioral changes.

Test: atest libsurfaceflinger_unittest
Bug: 309687765
Change-Id: I055d827a45ecc7f566375425c42e745a41b751f9
parent a021bb0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ layer_state_t::layer_state_t()
        defaultFrameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT),
        frameRateCategory(ANATIVEWINDOW_FRAME_RATE_CATEGORY_DEFAULT),
        frameRateCategorySmoothSwitchOnly(false),
        frameRateSelectionStrategy(ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_SELF),
        frameRateSelectionStrategy(ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_PROPAGATE),
        fixedTransformHint(ui::Transform::ROT_INVALID),
        autoRefresh(false),
        isTrustedOverlay(false),
+15 −11
Original line number Diff line number Diff line
@@ -1104,29 +1104,33 @@ enum {
    /**
     * Default value. The layer uses its own frame rate specifications, assuming it has any
     * specifications, instead of its parent's. If it does not have its own frame rate
     * specifications, it will try to use its parent's.
     * specifications, it will try to use its parent's. It will propagate its specifications to any
     * descendants that do not have their own.
     *
     * However, FRAME_RATE_SELECTION_STRATEGY_OVERRIDE_CHILDREN on an ancestor layer
     * supersedes this behavior, meaning that this layer will inherit the frame rate specifications
     * of that ancestor layer.
     * supersedes this behavior, meaning that this layer will inherit frame rate specifications
     * regardless of whether it has its own.
     */
    ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_SELF = 0,
    ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_PROPAGATE = 0,

    /**
     * The layer's frame rate specifications will propagate to and override those of its descendant
     * layers.
     * The layer with this strategy has the ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_SELF
     * behavior for itself.
     *
     * The layer itself has the FRAME_RATE_SELECTION_STRATEGY_PROPAGATE behavior.
     * Thus, ancestor layer that also has the strategy
     * FRAME_RATE_SELECTION_STRATEGY_OVERRIDE_CHILDREN will override this layer's
     * frame rate specifications.
     */
    ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_OVERRIDE_CHILDREN = 1,

    /**
     * The layer's frame rate specifications will never propagate to its descendant
     * layers.
     * FRAME_RATE_SELECTION_STRATEGY_OVERRIDE_CHILDREN on an ancestor layer supersedes
     * this behavior.
     * The layer's frame rate specifications will not propagate to its descendant
     * layers, even if the descendant layer has no frame rate specifications.
     * However, FRAME_RATE_SELECTION_STRATEGY_OVERRIDE_CHILDREN on an ancestor
     * layer supersedes this behavior.
     */
    ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_DO_NOT_PROPAGATE = 2,
    ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_SELF = 2,
};

static inline int native_window_set_frame_rate(struct ANativeWindow* window, float frameRate,
+1 −1
Original line number Diff line number Diff line
@@ -817,7 +817,7 @@ void LayerSnapshotBuilder::updateSnapshot(LayerSnapshot& snapshot, const Args& a
        const bool shouldOverrideChildren = parentSnapshot.frameRateSelectionStrategy ==
                scheduler::LayerInfo::FrameRateSelectionStrategy::OverrideChildren;
        const bool propagationAllowed = parentSnapshot.frameRateSelectionStrategy !=
                scheduler::LayerInfo::FrameRateSelectionStrategy::DoNotPropagate;
                scheduler::LayerInfo::FrameRateSelectionStrategy::Self;
        if ((!requested.requestedFrameRate.isValid() && propagationAllowed) ||
            shouldOverrideChildren) {
            snapshot.inheritedFrameRate = parentSnapshot.inheritedFrameRate;
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ RequestedLayerState::RequestedLayerState(const LayerCreationArgs& args)
    frameRateCategory = static_cast<int8_t>(FrameRateCategory::Default);
    frameRateCategorySmoothSwitchOnly = false;
    frameRateSelectionStrategy =
            static_cast<int8_t>(scheduler::LayerInfo::FrameRateSelectionStrategy::Self);
            static_cast<int8_t>(scheduler::LayerInfo::FrameRateSelectionStrategy::Propagate);
    dataspace = ui::Dataspace::V0_SRGB;
    gameMode = gui::GameMode::Unsupported;
    requestedFrameRate = {};
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ Layer::Layer(const surfaceflinger::LayerCreationArgs& args)
    mDrawingState.dropInputMode = gui::DropInputMode::NONE;
    mDrawingState.dimmingEnabled = true;
    mDrawingState.defaultFrameRateCompatibility = FrameRateCompatibility::Default;
    mDrawingState.frameRateSelectionStrategy = FrameRateSelectionStrategy::Self;
    mDrawingState.frameRateSelectionStrategy = FrameRateSelectionStrategy::Propagate;

    if (args.flags & ISurfaceComposerClient::eNoColorFill) {
        // Set an invalid color so there is no color fill.
Loading