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

Commit b83097dd authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Enable effect layers with blur

Change-Id: Ia13f0b6d816aa918433297567735482dc5b3502e
Test: launch apps
Bug: 149792636
Fixes: 148804546
parent 40e7078c
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,8 @@ std::vector<compositionengine::LayerFE::LayerSettings> EffectLayer::prepareClien
        // Set color for color fill settings.
        // Set color for color fill settings.
        layerSettings->source.solidColor = getColor().rgb;
        layerSettings->source.solidColor = getColor().rgb;
        results.push_back(*layerSettings);
        results.push_back(*layerSettings);
    } else if (hasBlur()) {
        results.push_back(*layerSettings);
    }
    }


    return results;
    return results;
@@ -148,6 +150,10 @@ bool EffectLayer::fillsColor() const {
            mDrawingState.color.b >= 0.0_hf;
            mDrawingState.color.b >= 0.0_hf;
}
}


bool EffectLayer::hasBlur() const {
    return getBackgroundBlurRadius() > 0;
}

} // namespace android
} // namespace android


// TODO(b/129481165): remove the #pragma below and fix conversion issues
// TODO(b/129481165): remove the #pragma below and fix conversion issues
+3 −1
Original line number Original line Diff line number Diff line
@@ -62,7 +62,9 @@ protected:
private:
private:
    // Returns true if there is a valid color to fill.
    // Returns true if there is a valid color to fill.
    bool fillsColor() const;
    bool fillsColor() const;
    bool hasSomethingToDraw() const { return fillsColor() || drawShadows(); }
    // Returns true if this layer has a blur value.
    bool hasBlur() const;
    bool hasSomethingToDraw() const { return fillsColor() || drawShadows() || hasBlur(); }
};
};


} // namespace android
} // namespace android