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

Commit 575144fa authored by chaviw's avatar chaviw Committed by Chavi Weingarten
Browse files

Added opaque flag check for ColorLayer

Currently ColorLayers ignore the opaque flag which is incorrect
behavior. ColorLayer now overrides the isOpaque check to see if the
opauqe flag is set.

If the opaque flag is not set, but has alpha 1, the content on
screen will look the same. However, SF will try to draw any layer
behind the ColorLayer since it doesn't know that the ColorLayer
will obscure it. This is inefficient and could cause rendering to go
into GL composition since it will be creating more rendering layers
than what's needed.

Test: ColorLayers can be opaque
Change-Id: Iab41ae23f17905d61f0ab40a060d53831cf34735
parent c603c81d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -108,6 +108,10 @@ std::shared_ptr<compositionengine::Layer> ColorLayer::getCompositionLayer() cons
    return mCompositionLayer;
}

bool ColorLayer::isOpaque(const Layer::State& s) const {
    return (s.flags & layer_state_t::eLayerOpaque) != 0;
}

// ---------------------------------------------------------------------------

}; // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ public:

    void commitTransaction(const State& stateToCommit) override;

    bool isOpaque(const Layer::State& s) const override;

protected:
    /*
     * compositionengine::LayerFE overrides