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

Commit 01b93b13 authored by Nolan Scobie's avatar Nolan Scobie
Browse files

Re-enable RE test ..._premultipliesAlpha on Graphite w/ tolerance 1

Ganesh rounds this more consistently than Graphite, but Graphite's
approach is technically more correct. See egdaniel@'s description at
b/331446496#comment5

Bug: b/331446496
Change-Id: Ib1fd7975f36ccc114cef3b0cdd60ac173df62a69
Test: librenderengine_test
parent efd55b1a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1265,7 +1265,12 @@ void RenderEngineTest::fillRedBufferWithPremultiplyAlpha() {

void RenderEngineTest::fillBufferWithPremultiplyAlpha() {
    fillRedBufferWithPremultiplyAlpha();
    expectBufferColor(fullscreenRect(), 128, 0, 0, 128);
    // Different backends and GPUs may round 255 * 0.5 = 127.5 differently, but
    // either 127 or 128 are acceptable. Checking both 127 and 128 with a
    // tolerance of 1 allows either 127 or 128 to pass, while preventing 126 or
    // 129 from erroneously passing.
    expectBufferColor(fullscreenRect(), 127, 0, 0, 127, 1);
    expectBufferColor(fullscreenRect(), 128, 0, 0, 128, 1);
}

void RenderEngineTest::fillRedBufferWithoutPremultiplyAlpha() {
@@ -2061,11 +2066,6 @@ TEST_P(RenderEngineTest, drawLayers_fillBufferTextureTransform) {
}

TEST_P(RenderEngineTest, drawLayers_fillBuffer_premultipliesAlpha) {
    // TODO: b/331446496 - Fix in Graphite and re-enable.
    if (GetParam()->skiaBackend() == renderengine::RenderEngine::SkiaBackend::GRAPHITE) {
        GTEST_SKIP();
    }

    if (!GetParam()->apiSupported()) {
        GTEST_SKIP();
    }