Skip to content

Commit d0441f9

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "fix a small bug that caused screenshot to show garbage in some cases (DO NOT MERGE)" into gingerbread
2 parents 043a3cd + 8aa11d8 commit d0441f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
21142114

21152115
// invert everything, b/c glReadPixel() below will invert the FB
21162116
glViewport(0, 0, sw, sh);
2117+
glScissor(0, 0, sw, sh);
21172118
glMatrixMode(GL_PROJECTION);
21182119
glPushMatrix();
21192120
glLoadIdentity();
@@ -2123,6 +2124,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
21232124
// redraw the screen entirely...
21242125
glClearColor(0,0,0,1);
21252126
glClear(GL_COLOR_BUFFER_BIT);
2127+
21262128
const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
21272129
const size_t count = layers.size();
21282130
for (size_t i=0 ; i<count ; ++i) {
@@ -2157,7 +2159,6 @@ status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
21572159
result = NO_MEMORY;
21582160
}
21592161
}
2160-
21612162
glEnable(GL_SCISSOR_TEST);
21622163
glViewport(0, 0, hw_w, hw_h);
21632164
glMatrixMode(GL_PROJECTION);

0 commit comments

Comments
 (0)