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

Commit 6f942603 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[RenderEngine] correct alpha blending func"

parents 653ae188 6f3c0bb2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1129,7 +1129,8 @@ void GLESRenderEngine::setupLayerBlending(bool premultipliedAlpha, bool opaque,

    if (color.a < 1.0f || !opaque || cornerRadius > 0.0f) {
        glEnable(GL_BLEND);
        glBlendFunc(premultipliedAlpha ? GL_ONE : GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glBlendFuncSeparate(premultipliedAlpha ? GL_ONE : GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
                            GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
    } else {
        glDisable(GL_BLEND);
    }
+1 −1
Original line number Diff line number Diff line
@@ -734,7 +734,7 @@ void RenderEngineTest::fillRedBufferWithoutPremultiplyAlpha() {

void RenderEngineTest::fillBufferWithoutPremultiplyAlpha() {
    fillRedBufferWithoutPremultiplyAlpha();
    expectBufferColor(fullscreenRect(), 128, 0, 0, 64, 1);
    expectBufferColor(fullscreenRect(), 128, 0, 0, 128, 1);
}

void RenderEngineTest::clearLeftRegion() {