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

Commit 228b500f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "[RenderEngine] correct alpha blending func" am: 6f942603 am:...

Merge "[RenderEngine] correct alpha blending func" am: 6f942603 am: 9592c9d5 am: d0567ad4 am: 444c9835

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1391116

Change-Id: I59f1be5a6465fc64012c45e7dd1dec7eea8e647e
parents 7043031c 444c9835
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1274,7 +1274,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
@@ -917,7 +917,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() {