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

Commit c7b0c75f authored by Lloyd Pique's avatar Lloyd Pique
Browse files

SF: Move/Refactor updateCursorAsync to CompositionEngine

As part of this change, the existing LayerFE::latchCompositionState is
extended to allow for more state types to be fetched.

Test: atest libsurfaceflinger_unittest libcompositionengine_test
Bug: 121291683
Change-Id: I71e0f547440a64c1025f36741beb68e72c18e475
parent 6a3b4469
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ public:
    virtual bool needsAnotherUpdate() const = 0;
    virtual nsecs_t getLastFrameRefreshTimestamp() const = 0;

    // Updates the cursor position for the indicated outputs.
    virtual void updateCursorAsync(CompositionRefreshArgs&) = 0;

    // TODO(b/121291683): These will become private/internal
    virtual void preComposition(CompositionRefreshArgs&) = 0;
};
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ public:
    // geometry state can be skipped.
    virtual void latchCompositionState(LayerFECompositionState&, bool includeGeometry) const = 0;

    // Latches the minimal bit of state for the cursor for a fast asynchronous
    // update.
    virtual void latchCursorCompositionState(LayerFECompositionState&) const = 0;

    struct ClientCompositionTargetSettings {
        // The clip region, or visible region that is being rendered to
        const Region& clip;
+7 −0
Original line number Diff line number Diff line
@@ -122,6 +122,13 @@ struct LayerFECompositionState {

    // True if the layer has protected content
    bool hasProtectedContent{false};

    /*
     * Cursor state
     */

    // The output-independent frame for the cursor
    Rect cursorFrame;
};

} // namespace android::compositionengine
+6 −0
Original line number Diff line number Diff line
@@ -78,12 +78,18 @@ public:
    // skipped.
    virtual void writeStateToHWC(bool includeGeometry) = 0;

    // Updates the cursor position with the HWC
    virtual void writeCursorPositionToHWC() const = 0;

    // Returns the HWC2::Layer associated with this layer, if it exists
    virtual HWC2::Layer* getHwcLayer() const = 0;

    // Returns true if the current layer state requires client composition
    virtual bool requiresClientComposition() const = 0;

    // Returns true if the current layer should be treated as a cursor layer
    virtual bool isHardwareCursor() const = 0;

    // Applies a HWC device requested composition type change
    virtual void applyDeviceCompositionTypeChange(Hwc2::IComposerClient::Composition) = 0;

+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ public:
    bool needsAnotherUpdate() const override;
    nsecs_t getLastFrameRefreshTimestamp() const override;

    void updateCursorAsync(CompositionRefreshArgs&) override;

    void preComposition(CompositionRefreshArgs&) override;

    // Testing
Loading