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

Commit c0fc357d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Make blur sysprop persist across boots" into rvc-dev am: a4b4999e

Change-Id: Ieed9f13215168f01f1eb7ced3a943731a17bcc37
parents a08f81d6 a4b4999e
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -364,11 +364,8 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI

    property_get("ro.surface_flinger.supports_background_blur", value, "0");
    bool supportsBlurs = atoi(value);
    property_get("debug.sf.disable_blurs", value, "0");
    bool disableBlurs = atoi(value);
    mEnableBlurs = supportsBlurs && !disableBlurs;
    ALOGI_IF(!mEnableBlurs, "Disabling blur effects. supported: %d, disabled: %d", supportsBlurs,
             disableBlurs);
    mSupportsBlur = supportsBlurs;
    ALOGI_IF(!mSupportsBlur, "Disabling blur effects, they are not supported.");
    property_get("ro.sf.blurs_are_expensive", value, "0");
    mBlursAreExpensive = atoi(value);

@@ -625,7 +622,7 @@ void SurfaceFlinger::init() {
                .setUseColorManagerment(useColorManagement)
                .setEnableProtectedContext(enable_protected_contents(false))
                .setPrecacheToneMapperShaderOnly(false)
                .setSupportsBackgroundBlur(mEnableBlurs)
                .setSupportsBackgroundBlur(mSupportsBlur)
                .setContextPriority(useContextPriority
                        ? renderengine::RenderEngine::ContextPriority::HIGH
                        : renderengine::RenderEngine::ContextPriority::MEDIUM)
@@ -707,6 +704,11 @@ void SurfaceFlinger::readPersistentProperties() {

    property_get("persist.sys.sf.color_mode", value, "0");
    mForceColorMode = static_cast<ColorMode>(atoi(value));

    property_get("persist.sys.sf.disable_blurs", value, "0");
    bool disableBlurs = atoi(value);
    mDisableBlurs = disableBlurs;
    ALOGI_IF(disableBlurs, "Disabling blur effects, user preference.");
}

void SurfaceFlinger::startBootAnim() {
@@ -3594,7 +3596,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(
        if (layer->setCornerRadius(s.cornerRadius))
            flags |= eTraversalNeeded;
    }
    if (what & layer_state_t::eBackgroundBlurRadiusChanged) {
    if (what & layer_state_t::eBackgroundBlurRadiusChanged && !mDisableBlurs) {
        if (layer->setBackgroundBlurRadius(s.backgroundBlurRadius)) flags |= eTraversalNeeded;
    }
    if (what & layer_state_t::eLayerStackChanged) {
+3 −1
Original line number Diff line number Diff line
@@ -1060,8 +1060,10 @@ private:
    const std::shared_ptr<TimeStats> mTimeStats;
    const std::unique_ptr<FrameTracer> mFrameTracer;
    bool mUseHwcVirtualDisplays = false;
    // If blurs should be enabled on this device.
    bool mSupportsBlur = false;
    // Disable blurs, for debugging
    bool mEnableBlurs = false;
    std::atomic<bool> mDisableBlurs = false;
    // If blurs are considered expensive and should require high GPU frequency.
    bool mBlursAreExpensive = false;
    std::atomic<uint32_t> mFrameMissedCount = 0;