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

Commit f729f507 authored by Lloyd Pique's avatar Lloyd Pique Committed by Android (Google) Code Review
Browse files

Merge "SF: Dev Options should force client composition for all frames"

parents 2511dfa1 7a234910
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ public:


    // Recalculates the state of the output layer from the output-independent
    // Recalculates the state of the output layer from the output-independent
    // layer. If includeGeometry is false, the geometry state can be skipped.
    // layer. If includeGeometry is false, the geometry state can be skipped.
    virtual void updateCompositionState(bool includeGeometry) = 0;
    virtual void updateCompositionState(bool includeGeometry, bool forceClientComposition) = 0;


    // Writes the geometry state to the HWC, or does nothing if this layer does
    // Writes the geometry state to the HWC, or does nothing if this layer does
    // not use the HWC. If includeGeometry is false, the geometry state can be
    // not use the HWC. If includeGeometry is false, the geometry state can be
+1 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ public:


    void setHwcLayer(std::shared_ptr<HWC2::Layer>) override;
    void setHwcLayer(std::shared_ptr<HWC2::Layer>) override;


    void updateCompositionState(bool) override;
    void updateCompositionState(bool includeGeometry, bool forceClientComposition) override;
    void writeStateToHWC(bool) override;
    void writeStateToHWC(bool) override;
    void writeCursorPositionToHWC() const override;
    void writeCursorPositionToHWC() const override;


+1 −1
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@ public:
    MOCK_CONST_METHOD0(getState, const impl::OutputLayerCompositionState&());
    MOCK_CONST_METHOD0(getState, const impl::OutputLayerCompositionState&());
    MOCK_METHOD0(editState, impl::OutputLayerCompositionState&());
    MOCK_METHOD0(editState, impl::OutputLayerCompositionState&());


    MOCK_METHOD1(updateCompositionState, void(bool));
    MOCK_METHOD2(updateCompositionState, void(bool, bool));
    MOCK_METHOD1(writeStateToHWC, void(bool));
    MOCK_METHOD1(writeStateToHWC, void(bool));
    MOCK_CONST_METHOD0(writeCursorPositionToHWC, void());
    MOCK_CONST_METHOD0(writeCursorPositionToHWC, void());


+2 −5
Original line number Original line Diff line number Diff line
@@ -552,11 +552,8 @@ void Output::updateAndWriteCompositionState(
    ALOGV(__FUNCTION__);
    ALOGV(__FUNCTION__);


    for (auto* layer : getOutputLayersOrderedByZ()) {
    for (auto* layer : getOutputLayersOrderedByZ()) {
        if (refreshArgs.devOptForceClientComposition) {
        layer->updateCompositionState(refreshArgs.updatingGeometryThisFrame,
            layer->editState().forceClientComposition = true;
                                      refreshArgs.devOptForceClientComposition);
        }

        layer->updateCompositionState(refreshArgs.updatingGeometryThisFrame);


        // Send the updated state to the HWC, if appropriate.
        // Send the updated state to the HWC, if appropriate.
        layer->writeStateToHWC(refreshArgs.updatingGeometryThisFrame);
        layer->writeStateToHWC(refreshArgs.updatingGeometryThisFrame);
+3 −2
Original line number Original line Diff line number Diff line
@@ -259,7 +259,7 @@ uint32_t OutputLayer::calculateOutputRelativeBufferTransform() const {
    return transform.getOrientation();
    return transform.getOrientation();
} // namespace impl
} // namespace impl


void OutputLayer::updateCompositionState(bool includeGeometry) {
void OutputLayer::updateCompositionState(bool includeGeometry, bool forceClientComposition) {
    const auto& layerFEState = getLayer().getFEState();
    const auto& layerFEState = getLayer().getFEState();
    const auto& outputState = getOutput().getState();
    const auto& outputState = getOutput().getState();
    const auto& profile = *getOutput().getDisplayColorProfile();
    const auto& profile = *getOutput().getDisplayColorProfile();
@@ -294,7 +294,8 @@ void OutputLayer::updateCompositionState(bool includeGeometry) {


    // These are evaluated every frame as they can potentially change at any
    // These are evaluated every frame as they can potentially change at any
    // time.
    // time.
    if (layerFEState.forceClientComposition || !profile.isDataspaceSupported(state.dataspace)) {
    if (layerFEState.forceClientComposition || !profile.isDataspaceSupported(state.dataspace) ||
        forceClientComposition) {
        state.forceClientComposition = true;
        state.forceClientComposition = true;
    }
    }
}
}
Loading