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

Commit 0d028791 authored by Ady Abraham's avatar Ady Abraham
Browse files

Surface Flinger: return false from ColorLayer::onPreComposition()

When setting a color on ISurfaceComposerClient::eFXSurfaceColor,
eTransactionNeeded will be set and SurfaceFlinfer will
process it as part of the transaction. There is no need for
a second invalidate for eFXSurfaceColor as there is no
buffer associated with it.

Bug: 112345149
Bug: 113091768
Test: adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test
Change-Id: I6c70492f2de317ce839d516e910d95091cb4b351
parent 12c631b5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ public:

    void setPerFrameData(const sp<const DisplayDevice>& display) override;

    bool onPreComposition(nsecs_t /*refreshStartTime*/) override { return false; }

protected:
    FloatRect computeCrop(const sp<const DisplayDevice>& /*display*/) const override { return {}; }
};
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ public:
    void setPerFrameData(const sp<const DisplayDevice>& display) override;

    bool isCreatedFromMainThread() const override { return true; }

    bool onPreComposition(nsecs_t /*refreshStartTime*/) override { return false; }
};

} // namespace android
+1 −1
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ public:
     * called before composition.
     * returns true if the layer has pending updates.
     */
    virtual bool onPreComposition(nsecs_t /*refreshStartTime*/) { return true; }
    virtual bool onPreComposition(nsecs_t refreshStartTime) = 0;

    /*
     * called after composition.
+0 −4
Original line number Diff line number Diff line
@@ -553,10 +553,6 @@ struct BaseLayerProperties {
                                  IComposerClient::Color({0xff, 0xff, 0xff, 0xff})))
                .Times(1);

        // TODO: ColorLayer::onPreComposition() always returns true, triggering an
        // extra layer update in SurfaceFlinger::preComposition(). This seems
        // wrong on the surface.
        EXPECT_CALL(*test->mMessageQueue, invalidate()).Times(1);
    }

    static void setupHwcSetPerFrameBufferCallExpectations(CompositionTest* test) {