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

Commit 5d4e24ed authored by Lloyd Pique's avatar Lloyd Pique
Browse files

CE: Default-Initialize shadowRadius and a timestamp

The unit tests in particular assume that all values are initialzed to
some reasonable default.

The OutputTest takesEarlyOutIfLayerHasEmptyVisibleRegion was aborting on
an integer overflow inside Rect::inset() because an uninitialized
shadowRadius was being converted to -INT32_MIN.

The OutputTest gathersClientCompositionRequests() was sometimes failing because it
assumes that the timestamp is set to zero by default, and is set to a
(nonzero) value by the code under test.

With both these fixes, the CompositionEngine tests pass.

Test: atest libcompositionengine_test
Bug: None
Change-Id: I7ff56a0f24f6d5960493b18458f52766f955151d
parent 26afdce9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ struct LayerFECompositionState {
    FloatRect geomLayerBounds;
    FloatRect geomLayerBounds;


    // length of the shadow in screen space
    // length of the shadow in screen space
    float shadowRadius;
    float shadowRadius{0.f};


    /*
    /*
     * Geometry state
     * Geometry state
+1 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ struct OutputLayerCompositionState {
    void dump(std::string& result) const;
    void dump(std::string& result) const;


    // Timestamp for when the layer is queued for client composition
    // Timestamp for when the layer is queued for client composition
    nsecs_t clientCompositionTimestamp;
    nsecs_t clientCompositionTimestamp{0};
};
};


} // namespace compositionengine::impl
} // namespace compositionengine::impl