summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/MessageQueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/MessageQueue.cpp')
-rw-r--r--services/surfaceflinger/MessageQueue.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index 3f77f74..c9c7b96 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -61,6 +61,12 @@ void MessageQueue::Handler::dispatchInvalidate() {
}
}
+void MessageQueue::Handler::dispatchTransaction() {
+ if ((android_atomic_or(eventMaskTransaction, &mEventMask) & eventMaskTransaction) == 0) {
+ mQueue.mLooper->sendMessage(this, Message(MessageQueue::TRANSACTION));
+ }
+}
+
void MessageQueue::Handler::handleMessage(const Message& message) {
switch (message.what) {
case INVALIDATE:
@@ -71,6 +77,10 @@ void MessageQueue::Handler::handleMessage(const Message& message) {
android_atomic_and(~eventMaskRefresh, &mEventMask);
mQueue.mFlinger->onMessageReceived(message.what);
break;
+ case TRANSACTION:
+ android_atomic_and(~eventMaskTransaction, &mEventMask);
+ mQueue.mFlinger->onMessageReceived(message.what);
+ break;
}
}
@@ -132,6 +142,7 @@ status_t MessageQueue::postMessage(
return NO_ERROR;
}
+
/* when INVALIDATE_ON_VSYNC is set SF only processes
* buffer updates on VSYNC and performs a refresh immediately
* after.
@@ -143,6 +154,10 @@ status_t MessageQueue::postMessage(
*/
#define INVALIDATE_ON_VSYNC 1
+void MessageQueue::invalidateTransactionNow() {
+ mHandler->dispatchTransaction();
+}
+
void MessageQueue::invalidate() {
#if INVALIDATE_ON_VSYNC
mEvents->requestNextVsync();