From 58737fe96d9e5027e36a983161ab1888592b3eb8 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 31 Jan 2012 16:42:54 -0800 Subject: fix an issue with vsync event delivery vsync events were sometimes delivered to connected client who didn't request them. this happened if another client requested the delivery and that client was first in the client list. also fix the vsync test which didn't request any events as well as DisplayEventReveiver documentation which was misleading about the necessity to request vsync events. Change-Id: Ie990fda3f337f8f0042745c4b2cde67936c45686 --- services/surfaceflinger/EventThread.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'services/surfaceflinger/EventThread.cpp') diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp index 92d4266a8fd9..af0da0bdb22c 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= 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; -- cgit v1.2.3-59-g8ed1b