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

Commit 55801e41 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

we were not always clearing the screen properly

Change-Id: I269dd866e965aebd9b3c4667095818202982f4a3
parent 525705c8
Loading
Loading
Loading
Loading
+11 −12
Original line number Original line Diff line number Diff line
@@ -1288,7 +1288,7 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
            // screen is already cleared here
            // screen is already cleared here
            if (!region.isEmpty()) {
            if (!region.isEmpty()) {
                // can happen with SurfaceView
                // can happen with SurfaceView
                drawWormhole(region);
                drawWormhole(hw, region);
            }
            }
        }
        }


@@ -1328,27 +1328,26 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
    }
    }
}
}


void SurfaceFlinger::drawWormhole(const Region& region) const
void SurfaceFlinger::drawWormhole(const sp<const DisplayDevice>& hw,
        const Region& region) const
{
{
    glDisable(GL_TEXTURE_EXTERNAL_OES);
    glDisable(GL_TEXTURE_EXTERNAL_OES);
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_BLEND);
    glDisable(GL_BLEND);
    glColor4f(0,0,0,0);
    glColor4f(0,0,0,0);


    GLfloat vertices[4][2];
    const int32_t height = hw->getHeight();
    glVertexPointer(2, GL_FLOAT, 0, vertices);
    Region::const_iterator it = region.begin();
    Region::const_iterator it = region.begin();
    Region::const_iterator const end = region.end();
    Region::const_iterator const end = region.end();
    while (it != end) {
    while (it != end) {
        const Rect& r = *it++;
        const Rect& r = *it++;
        vertices[0][0] = r.left;
        GLfloat vertices[][2] = {
        vertices[0][1] = r.top;
                { r.left,  height - r.top },
        vertices[1][0] = r.right;
                { r.left,  height - r.bottom },
        vertices[1][1] = r.top;
                { r.right, height - r.bottom },
        vertices[2][0] = r.right;
                { r.right, height - r.top }
        vertices[2][1] = r.bottom;
        };
        vertices[3][0] = r.left;
        glVertexPointer(2, GL_FLOAT, 0, vertices);
        vertices[3][1] = r.bottom;
        glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
        glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
    }
    }
}
}
+2 −1
Original line number Original line Diff line number Diff line
@@ -367,7 +367,8 @@ private:
            const Region& dirty);
            const Region& dirty);


    void postFramebuffer();
    void postFramebuffer();
    void drawWormhole(const Region& region) const;
    void drawWormhole(const sp<const DisplayDevice>& hw,
            const Region& region) const;
    GLuint getProtectedTexName() const {
    GLuint getProtectedTexName() const {
        return mProtectedTexName;
        return mProtectedTexName;
    }
    }