summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/MessageQueue.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-10-11 14:11:15 -0700
committerMathias Agopian <mathias@google.com>2010-10-11 14:11:15 -0700
commit7b0ba1668872eb6336bd305f9893991c84a08462 (patch)
treef79fea8a4592d418e233dbb5c43db6975b78431b /services/surfaceflinger/MessageQueue.cpp
parentaefa57869c0887ba3f796c6b553008b5b741a3ed (diff)
downloadframeworks_native-7b0ba1668872eb6336bd305f9893991c84a08462.zip
frameworks_native-7b0ba1668872eb6336bd305f9893991c84a08462.tar.gz
frameworks_native-7b0ba1668872eb6336bd305f9893991c84a08462.tar.bz2
deliver invalidate messages AFTER other messages
because invalidate messages were always handled first, they could prevent other messages to get through entirely. there is no real reason to handle invalidate messages first because the other messages are very uncommon and won't interfer with updates. Change-Id: Ib95cdf35a91407bd2f4d69dd082c5f546e1e0071
Diffstat (limited to 'services/surfaceflinger/MessageQueue.cpp')
-rw-r--r--services/surfaceflinger/MessageQueue.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index 4fb1e61..aebe1b8 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -72,14 +72,6 @@ sp<MessageBase> MessageQueue::waitMessage(nsecs_t timeout)
nsecs_t now = systemTime();
nsecs_t nextEventTime = -1;
- // invalidate messages are always handled first
- if (mInvalidate) {
- mInvalidate = false;
- mInvalidateMessage->when = now;
- result = mInvalidateMessage;
- break;
- }
-
LIST::iterator cur(mMessages.begin());
if (cur != mMessages.end()) {
result = *cur;
@@ -95,6 +87,14 @@ sp<MessageBase> MessageQueue::waitMessage(nsecs_t timeout)
result = 0;
}
+ // see if we have an invalidate message
+ if (mInvalidate) {
+ mInvalidate = false;
+ mInvalidateMessage->when = now;
+ result = mInvalidateMessage;
+ break;
+ }
+
if (timeout >= 0) {
if (timeoutTime < now) {
// we timed-out, return a NULL message