diff options
author | Mathias Agopian <mathias@google.com> | 2010-12-16 18:46:17 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-12-16 18:47:29 -0800 |
commit | f653b897a449e10d6cbfb6e0812f7b0bb02d6482 (patch) | |
tree | b6514877dba7dfbff737216ae02e6ae2335a3585 /services | |
parent | 13be124fad4e2da6d491dbe3a2c2921a59176ad2 (diff) | |
download | frameworks_native-f653b897a449e10d6cbfb6e0812f7b0bb02d6482.zip frameworks_native-f653b897a449e10d6cbfb6e0812f7b0bb02d6482.tar.gz frameworks_native-f653b897a449e10d6cbfb6e0812f7b0bb02d6482.tar.bz2 |
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
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 7c4790f..825d90b 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -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); |