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

Commit 8da6b0e1 authored by Dominik Laskowski's avatar Dominik Laskowski Committed by Florian Mayer
Browse files

SF: Clean up forced refresh and repaint

Remove the misleading repaintEverything flag from CE, as it only affects
debug flashes (and the fullscreen strobe during refresh rate transitions
is of dubious utility). It also causes GPU virtual displays to recompose
despite not being dirty, but forcing repaint can be done by invalidating
geometry instead.

Clean up the Scheduler/SF interface to schedule invalidate, refresh, and
repaint. Fix atomicity of a few debug variables.

Bug: 182939859
Test: Toggle "Show surface updates" in dev settings.
Test: libcompositionengine_test
Change-Id: I176d01cab43e5ab4697b762fe3172b09f4f3d202
parent 29fa146d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -47,9 +47,6 @@ struct CompositionRefreshArgs {
    // All the layers that have queued updates.
    Layers layersWithQueuedFrames;

    // If true, forces the entire display to be considered dirty and repainted
    bool repaintEverything{false};

    // Controls how the color mode is chosen for an output
    OutputColorSetting outputColorSetting{OutputColorSetting::kEnhanced};

+1 −2
Original line number Diff line number Diff line
@@ -221,8 +221,7 @@ public:
    virtual OutputCompositionState& editState() = 0;

    // Gets the dirty region in layer stack space.
    // If repaintEverything is true, this will be the full display bounds.
    virtual Region getDirtyRegion(bool repaintEverything) const = 0;
    virtual Region getDirtyRegion() const = 0;

    // Returns whether the output includes a layer, based on their respective filters.
    // See Output::setLayerFilter.
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public:
    compositionengine::RenderSurface* getRenderSurface() const override;
    void setRenderSurface(std::unique_ptr<compositionengine::RenderSurface>) override;

    Region getDirtyRegion(bool repaintEverything) const override;
    Region getDirtyRegion() const override;

    bool includesLayer(ui::LayerFilter) const override;
    bool includesLayer(const sp<LayerFE>&) const override;
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public:
    MOCK_CONST_METHOD0(getState, const OutputCompositionState&());
    MOCK_METHOD0(editState, OutputCompositionState&());

    MOCK_CONST_METHOD1(getDirtyRegion, Region(bool));
    MOCK_METHOD(Region, getDirtyRegion, (), (const));

    MOCK_CONST_METHOD1(getOutputLayerForLayer,
                       compositionengine::OutputLayer*(const sp<compositionengine::LayerFE>&));
+1 −2
Original line number Diff line number Diff line
@@ -361,8 +361,7 @@ void Display::finishFrame(const compositionengine::CompositionRefreshArgs& refre
    // 1) It is being handled by hardware composer, which may need this to
    //    keep its virtual display state machine in sync, or
    // 2) There is work to be done (the dirty region isn't empty)
    if (GpuVirtualDisplayId::tryCast(mId) &&
        getDirtyRegion(refreshArgs.repaintEverything).isEmpty()) {
    if (GpuVirtualDisplayId::tryCast(mId) && getDirtyRegion().isEmpty()) {
        ALOGV("Skipping display composition");
        return;
    }
Loading