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

Commit 9fa95adb authored by Kyong Hwa Bae's avatar Kyong Hwa Bae Committed by Steve Kondik
Browse files

SurfaceFlinger: Let HWC handle an alpha blending

                when either C2D or DYN is set

Before we only use GPU to blend an alpha value.
However C2D can also handle the alpha blending,
when the composition type is set to either C2D or DYN,
use HWC to handle this.
And set the alpha value of C2D to HWC_BLENDING_PREMULT,
so later C2D can set alpha blending parameter.

Change-Id: I53be1d4219fbf2467a6391276d59213858a50058
parent c8e70a85
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -177,7 +177,8 @@ void DisplayHardware::init(uint32_t dpy)
        } else {
            // We have hardware composition enabled. Check the composition type
            if (property_get("debug.composition.type", property, NULL) > 0) {
                if((strncmp(property, "c2d", 3)) == 0)
                if ((strncmp(property, "c2d", 3) == 0) ||
                    (strncmp(property, "dyn", 3) == 0))
                    mFlags |= C2D_COMPOSITION;
                else if ((strncmp(property, "mdp", 3)) == 0)
                    mFlags |= MDP_COMPOSITION;
+0 −0

File mode changed from 100644 to 100755.

+7 −3
Original line number Diff line number Diff line
@@ -205,10 +205,14 @@ void Layer::setGeometry(hwc_layer_t* hwcl)
    // we can't do alpha-fade with the hwc HAL. C2D composition
    // can handle fade cases
    const State& s(drawingState());
    if ((s.alpha < 0xFF) &&
        !(DisplayHardware::C2D_COMPOSITION & hw.getFlags())) {
    if (s.alpha < 0xFF) {
        if ((DisplayHardware::C2D_COMPOSITION & hw.getFlags()) && (!isOpaque())) {
            hwcl->blending = mPremultipliedAlpha ?
                HWC_BLENDING_PREMULT : HWC_BLENDING_COVERAGE;
        } else {
            hwcl->flags = HWC_SKIP_LAYER;
        }
    }

    hwcl->alpha = s.alpha;
#else