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

Commit f653b897 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix a small bug that caused screenshot to show garbage in some cases

we were not clearing the screen entirely, which caused garbage when
the screen wasn't entirely covered by windows.

Change-Id: Ie9ab9b94eabfa6cafddf45bb14bc733bdc8d35c0
parent 13be124f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2123,6 +2123,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,

        // invert everything, b/c glReadPixel() below will invert the FB
        glViewport(0, 0, sw, sh);
        glScissor(0, 0, sw, sh);
        glMatrixMode(GL_PROJECTION);
        glPushMatrix();
        glLoadIdentity();
@@ -2132,6 +2133,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
        // redraw the screen entirely...
        glClearColor(0,0,0,1);
        glClear(GL_COLOR_BUFFER_BIT);

        const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
        const size_t count = layers.size();
        for (size_t i=0 ; i<count ; ++i) {
@@ -2169,7 +2171,6 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
                result = NO_MEMORY;
            }
        }

        glEnable(GL_SCISSOR_TEST);
        glViewport(0, 0, hw_w, hw_h);
        glMatrixMode(GL_PROJECTION);