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

Commit 0c1c5c98 authored by chihtinglo's avatar chihtinglo
Browse files

fix(edt): Invert the shadow colors in EDT

In EDT, we would like to invert the view shadow color to avoid the
low contrast issue when having a black view on top of a black
background.

Bug: 438631202
Bug: 436294586
Test: manually. attach screenshot to the bug
Flag: android.view.accessibility.force_invert_color
Change-Id: I67ed8ab9b3a5570d22299839e29988780305911a
parent c4d43324
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -457,6 +457,18 @@ void RenderNode::handleForceDark(android::uirenderer::TreeInfo* info) {
            transform = ColorTransform::Invert;
        }
        mDisplayList.applyColorTransform(transform);
        if (mProperties.hasShadow()) {
            SkColor newAmbientShadowColor =
                    transformColor(ColorTransform::Invert,
                                   SkColor4f::FromColor(mProperties.getAmbientShadowColor()))
                            .toSkColor();
            SkColor newSpotShadowColor =
                    transformColor(ColorTransform::Invert,
                                   SkColor4f::FromColor(mProperties.getSpotShadowColor()))
                            .toSkColor();
            mProperties.setAmbientShadowColor(newAmbientShadowColor);
            mProperties.setSpotShadowColor(newSpotShadowColor);
        }
        return;
    }