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

Commit 9ddfce21 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: Move/refactor presentation loop to CompositionEngine"

parents 54884166 d7b429f6
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;

    // Presents the indicated outputs
    virtual void present(CompositionRefreshArgs&) = 0;

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

+9 −21
Original line number Diff line number Diff line
@@ -159,34 +159,22 @@ public:
    // Takes (moves) the set of layers being released this frame.
    virtual ReleasedLayers takeReleasedLayers() = 0;

    // Presents the output, finalizing all composition details
    virtual void present(const compositionengine::CompositionRefreshArgs&) = 0;

    // Updates the color mode used on this output
    virtual void updateColorProfile(const CompositionRefreshArgs&) = 0;

    // Signals that a frame is beginning on the output
    virtual void beginFrame() = 0;
protected:
    virtual void setDisplayColorProfile(std::unique_ptr<DisplayColorProfile>) = 0;
    virtual void setRenderSurface(std::unique_ptr<RenderSurface>) = 0;

    // Prepares a frame for display
    virtual void beginFrame() = 0;
    virtual void prepareFrame() = 0;

    // Performs any debug related screen flashing due to the update
    virtual void devOptRepaintFlash(const CompositionRefreshArgs&) = 0;

    // Finishes the current frame on the output, performing client composition
    // and ensuring the content is displayed.
    virtual void finishFrame(const CompositionRefreshArgs&) = 0;

    // Performs client composition as needed for layers on the output. The
    // output fence is set to a fence to signal when client composition is
    // finished.
    // Returns std::nullopt if client composition cannot be performed.
    virtual void devOptRepaintFlash(const compositionengine::CompositionRefreshArgs&) = 0;
    virtual void finishFrame(const compositionengine::CompositionRefreshArgs&) = 0;
    virtual std::optional<base::unique_fd> composeSurfaces(const Region&) = 0;

    // Posts the new frame, and sets release fences.
    virtual void postFramebuffer() = 0;

protected:
    virtual void setDisplayColorProfile(std::unique_ptr<DisplayColorProfile>) = 0;
    virtual void setRenderSurface(std::unique_ptr<RenderSurface>) = 0;
    virtual void chooseCompositionStrategy() = 0;
    virtual bool getSkipColorTransform() const = 0;
    virtual FrameFences presentAndGetFrameFences() = 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 present(CompositionRefreshArgs&) override;

    void updateCursorAsync(CompositionRefreshArgs&) override;

    void preComposition(CompositionRefreshArgs&) override;
+2 −0
Original line number Diff line number Diff line
@@ -75,6 +75,8 @@ public:
    void setReleasedLayers(ReleasedLayers&&) override;
    ReleasedLayers takeReleasedLayers() override;

    void present(const compositionengine::CompositionRefreshArgs&) override;

    void updateColorProfile(const compositionengine::CompositionRefreshArgs&) override;

    void beginFrame() override;
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public:
    MOCK_CONST_METHOD0(needsAnotherUpdate, bool());
    MOCK_CONST_METHOD0(getLastFrameRefreshTimestamp, nsecs_t());

    MOCK_METHOD1(present, void(CompositionRefreshArgs&));
    MOCK_METHOD1(updateCursorAsync, void(CompositionRefreshArgs&));
    MOCK_METHOD1(preComposition, void(CompositionRefreshArgs&));
};
Loading