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

Commit b39920b8 authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by Steve Kondik
Browse files

frameworks/native: SF: Adapt vertices to GL co-ordinates

Adapt co-ordinates in drawWormhole() from display co-ordinate system to
GL co-ordinate system.

Change-Id: Id25a9e63c38ceb242f6d67eaca9e88cb95aead42
CRs-Fixed:382824
parent 738f756b
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -1076,6 +1076,11 @@ void SurfaceFlinger::drawWormhole() const
    if (region.isEmpty())
        return;

#ifdef QCOM_HARDWARE
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    const int32_t height = hw.getHeight();
#endif

    glDisable(GL_TEXTURE_EXTERNAL_OES);
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_BLEND);
@@ -1088,13 +1093,20 @@ void SurfaceFlinger::drawWormhole() const
    while (it != end) {
        const Rect& r = *it++;
        vertices[0][0] = r.left;
        vertices[0][1] = r.top;
        vertices[1][0] = r.right;
        vertices[1][1] = r.top;
        vertices[2][0] = r.right;
        vertices[2][1] = r.bottom;
        vertices[3][0] = r.left;
#ifdef QCOM_HARDWARE
        vertices[0][1] = height - r.top;
        vertices[1][1] = height - r.top;
        vertices[2][1] = height - r.bottom;
        vertices[3][1] = height - r.bottom;
#else
        vertices[0][1] = r.top;
        vertices[1][1] = r.top;
        vertices[2][1] = r.bottom;
        vertices[3][1] = r.bottom;
#endif
        glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
    }
}