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

Commit 9968288e authored by bohu's avatar bohu Committed by Bo Hu
Browse files

fix drawWithOpengl

*sometime*, the background is still back

this is a temp fix for now to get the screen
to show something.

BUG: 76125889

Change-Id: I7f5975270414a34462c74ae093fbd3ef956c8e26
parent a5f61831
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -793,17 +793,27 @@ void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityT
    texCoords[2] = vec2(right, 1.0f - bottom);
    texCoords[3] = vec2(right, 1.0f - top);

    getBE().compositionInfo.re.preMultipliedAlpha = mPremultipliedAlpha;
    getBE().compositionInfo.re.opaque = isOpaque(s);
    getBE().compositionInfo.re.disableTexture = false;
    getBE().compositionInfo.re.color = getColor();
    getBE().compositionInfo.hwc.dataspace = mCurrentState.dataSpace;
    //getBE().compositionInfo.re.preMultipliedAlpha = mPremultipliedAlpha;
    //getBE().compositionInfo.re.opaque = isOpaque(s);
    //getBE().compositionInfo.re.disableTexture = false;
    //getBE().compositionInfo.re.color = getColor();
    //getBE().compositionInfo.hwc.dataspace = mCurrentState.dataSpace;

  auto& engine(mFlinger->getRenderEngine());
    engine.setupLayerBlending(mPremultipliedAlpha, isOpaque(s), false /* disableTexture */,
                              getColor());
    engine.setSourceDataSpace(mCurrentState.dataSpace);
    
    if (mCurrentState.dataSpace == HAL_DATASPACE_BT2020_ITU_PQ &&
        mConsumer->getCurrentApi() == NATIVE_WINDOW_API_MEDIA &&
        getBE().compositionInfo.mBuffer->getPixelFormat() == HAL_PIXEL_FORMAT_RGBA_1010102) {
        getBE().compositionInfo.re.Y410BT2020 = true;
        engine.setSourceY410BT2020(true);
    }

    engine.drawMesh(getBE().mMesh);
    engine.disableBlending();

    engine.setSourceY410BT2020(false);
}

uint32_t BufferLayer::getProducerStickyTransform() const {