diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-27 22:47:27 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-09-27 22:47:32 -0700 |
commit | 81384bf927c47a4efa653b14273084a13e67e3ac (patch) | |
tree | 8b79fb1636fff36530d7db782e738f47ab301945 | |
parent | 1a3c8950394b98f6f354456830208d70e87b8bb6 (diff) | |
download | frameworks_base-81384bf927c47a4efa653b14273084a13e67e3ac.zip frameworks_base-81384bf927c47a4efa653b14273084a13e67e3ac.tar.gz frameworks_base-81384bf927c47a4efa653b14273084a13e67e3ac.tar.bz2 |
don't emit GL commands when sf is in freeze mode
We were emitting GL commands, calling composition complete and releasing clients
without ever calling eglSwapBuffers(), which is completely wrong on non-direct
renders. This could cause transient drawing artifacts when unfreezing the
screen (upon orientaion change for instance) and could also block the clients
for ever as they are waiting for their previous buffer to be rendered.
-rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp index 065425d..4ee176c 100644 --- a/libs/surfaceflinger/SurfaceFlinger.cpp +++ b/libs/surfaceflinger/SurfaceFlinger.cpp @@ -491,7 +491,7 @@ bool SurfaceFlinger::threadLoop() handlePageFlip(); const DisplayHardware& hw(graphicPlane(0).displayHardware()); - if (LIKELY(hw.canDraw())) { + if (LIKELY(hw.canDraw() && !isFrozen())) { // repaint the framebuffer (if needed) handleRepaint(); @@ -512,14 +512,6 @@ bool SurfaceFlinger::threadLoop() void SurfaceFlinger::postFramebuffer() { - if (isFrozen()) { - // we are not allowed to draw, but pause a bit to make sure - // apps don't end up using the whole CPU, if they depend on - // surfaceflinger for synchronization. - usleep(8333); // 8.3ms ~ 120fps - return; - } - if (!mInvalidRegion.isEmpty()) { const DisplayHardware& hw(graphicPlane(0).displayHardware()); const nsecs_t now = systemTime(); |