From 14fab7dd794cd6bf29e6425340683c6221062b3c Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Thu, 1 Aug 2013 13:37:42 -0700 Subject: Drop frames based on presentation timestamp If there are two or more buffers pending that are ready for immediate presentation, drop all but the last one. Any code that didn't explicitly specify timestamps for buffers was using the default value (auto-generated "now"). As a result, surfaceflinger would drop frames whenever more than one buffer was queued. We now use zero as the auto-generated timestamp, and we don't set the timestamp in eglBeginFrame(). Change-Id: I187f42d33de227cd3411ff0dcd3b9ce1961457eb --- libs/gui/Surface.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libs/gui/Surface.cpp') diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 998ea8ac8c..e2ec6434ce 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -261,9 +261,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { Mutex::Autolock lock(mMutex); int64_t timestamp; if (mTimestamp == NATIVE_WINDOW_TIMESTAMP_AUTO) { - timestamp = systemTime(SYSTEM_TIME_MONOTONIC); - ALOGV("Surface::queueBuffer making up timestamp: %.2f ms", - timestamp / 1000000.f); + timestamp = 0; } else { timestamp = mTimestamp; } -- cgit v1.2.3-59-g8ed1b