summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/MessageQueue.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-04-10 16:27:17 -0700
committerMathias Agopian <mathias@google.com>2013-04-10 16:27:17 -0700
commit9eb1f0558b5fc78920602afe7bcfa3115bb1f6be (patch)
tree2bcc946139e627de49b4e67121e7f5d5ce9c3174 /services/surfaceflinger/MessageQueue.h
parent1df59c93fea8bec21b8084c34aface086f1e0896 (diff)
downloadframeworks_native-9eb1f0558b5fc78920602afe7bcfa3115bb1f6be.zip
frameworks_native-9eb1f0558b5fc78920602afe7bcfa3115bb1f6be.tar.gz
frameworks_native-9eb1f0558b5fc78920602afe7bcfa3115bb1f6be.tar.bz2
fix another bug where screenshots could end-up all black
SF transactions were always handled on VSYNC which allowed the screenshot to sneak-in between closing the transaction and vsync (before it's latched), resulting in a screenshot with the previous state. we now always force transactions to happen immediately before screenhots. Bug: 7552304 Change-Id: I0afc86b7e8366173daff5b9988bbb4d2a0f43860
Diffstat (limited to 'services/surfaceflinger/MessageQueue.h')
-rw-r--r--services/surfaceflinger/MessageQueue.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/services/surfaceflinger/MessageQueue.h b/services/surfaceflinger/MessageQueue.h
index 710b2c2..b77e08e 100644
--- a/services/surfaceflinger/MessageQueue.h
+++ b/services/surfaceflinger/MessageQueue.h
@@ -62,8 +62,9 @@ private:
class MessageQueue {
class Handler : public MessageHandler {
enum {
- eventMaskInvalidate = 0x1,
- eventMaskRefresh = 0x2
+ eventMaskInvalidate = 0x1,
+ eventMaskRefresh = 0x2,
+ eventMaskTransaction = 0x4
};
MessageQueue& mQueue;
int32_t mEventMask;
@@ -72,6 +73,7 @@ class MessageQueue {
virtual void handleMessage(const Message& message);
void dispatchRefresh();
void dispatchInvalidate();
+ void dispatchTransaction();
};
friend class Handler;
@@ -89,8 +91,9 @@ class MessageQueue {
public:
enum {
- INVALIDATE = 0,
- REFRESH = 1,
+ INVALIDATE = 0,
+ REFRESH = 1,
+ TRANSACTION = 2
};
MessageQueue();
@@ -100,8 +103,13 @@ public:
void waitMessage();
status_t postMessage(const sp<MessageBase>& message, nsecs_t reltime=0);
+
+ // sends INVALIDATE message at next VSYNC
void invalidate();
+ // sends REFRESH message at next VSYNC
void refresh();
+ // sends TRANSACTION message immediately
+ void invalidateTransactionNow();
};
// ---------------------------------------------------------------------------