diff options
author | Mathias Agopian <mathias@google.com> | 2012-01-31 16:46:27 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-31 16:46:27 -0800 |
commit | baf1c68c749e872a1278bcb2f401f7a0a3025841 (patch) | |
tree | b161932009f38f8fd794d92d852fc1f931ed8c1e /services | |
parent | 7fc1fc1bd024870b83e7b588be9053bdf7f699e5 (diff) | |
parent | 3cf199aef6250552555344944c3e3a6e4ab05f92 (diff) | |
download | frameworks_native-baf1c68c749e872a1278bcb2f401f7a0a3025841.zip frameworks_native-baf1c68c749e872a1278bcb2f401f7a0a3025841.tar.gz frameworks_native-baf1c68c749e872a1278bcb2f401f7a0a3025841.tar.bz2 |
Merge "fix an issue with vsync event delivery"
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/EventThread.cpp | 10 | ||||
-rw-r--r-- | services/surfaceflinger/tests/vsync/vsync.cpp | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp index 92d4266..af0da0b 100644 --- a/services/surfaceflinger/EventThread.cpp +++ b/services/surfaceflinger/EventThread.cpp @@ -151,9 +151,9 @@ bool EventThread::threadLoop() { mLastVSyncTimestamp = timestamp; // now see if we still need to report this VSYNC event - bool reportVsync = false; - size_t count = mDisplayEventConnections.size(); + const size_t count = mDisplayEventConnections.size(); for (size_t i=0 ; i<count ; i++) { + bool reportVsync = false; const ConnectionInfo& info( mDisplayEventConnections.valueAt(i)); if (info.count >= 1) { @@ -174,11 +174,7 @@ bool EventThread::threadLoop() { displayEventConnections.add(mDisplayEventConnections.keyAt(i)); } } - - if (reportVsync) { - break; - } - } while (true); + } while (!displayEventConnections.size()); // dispatch vsync events to listeners... vsync.header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC; diff --git a/services/surfaceflinger/tests/vsync/vsync.cpp b/services/surfaceflinger/tests/vsync/vsync.cpp index 4f79080..b0d54c4 100644 --- a/services/surfaceflinger/tests/vsync/vsync.cpp +++ b/services/surfaceflinger/tests/vsync/vsync.cpp @@ -55,6 +55,8 @@ int main(int argc, char** argv) loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver, &myDisplayEvent); + myDisplayEvent.setVsyncRate(1); + do { //printf("about to poll...\n"); int32_t ret = loop->pollOnce(-1); |