summaryrefslogtreecommitdiffstats
path: root/include/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-12-06 17:22:19 -0800
committerMathias Agopian <mathias@google.com>2011-12-06 22:43:10 -0800
commit478ae5eb5a0047e1b2988c896cff6363b455ee50 (patch)
treebb3e26939a6b6a0c0b0b5ab4b12fe4f0dc5d7bf3 /include/gui
parent9bbbcf8c65771e581a8bdbe5d1cc70e3faf310ab (diff)
downloadframeworks_native-478ae5eb5a0047e1b2988c896cff6363b455ee50.zip
frameworks_native-478ae5eb5a0047e1b2988c896cff6363b455ee50.tar.gz
frameworks_native-478ae5eb5a0047e1b2988c896cff6363b455ee50.tar.bz2
Improve the VSYNC api a bit.
- add the ability to set the vsync delivery rate, when the rate is set to N>1 (ie: receive every N vsync), SF process' is woken up for all of vsync, but clients only see the every N events. - add the concept of one-shot vsync events, with a call-back to request the next one. currently the call-back is a binder IPC. Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/DisplayEventReceiver.h14
-rw-r--r--include/gui/IDisplayEventConnection.h18
2 files changed, 32 insertions, 0 deletions
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
index 8d07c0e..dccc164 100644
--- a/include/gui/DisplayEventReceiver.h
+++ b/include/gui/DisplayEventReceiver.h
@@ -94,6 +94,20 @@ public:
*/
ssize_t getEvents(Event* events, size_t count);
+ /*
+ * setVsyncRate() sets the Event::VSync delivery rate. A value of
+ * 1 returns every Event::VSync. A value of 2 returns every other event,
+ * etc... a value of 0 returns no event unless requestNextVsync() has
+ * been called.
+ */
+ status_t setVsyncRate(uint32_t count);
+
+ /*
+ * requestNextVsync() schedules the next Event::VSync. It has no effect
+ * if the vsync rate is > 0.
+ */
+ status_t requestNextVsync();
+
private:
sp<IDisplayEventConnection> mEventConnection;
sp<BitTube> mDataChannel;
diff --git a/include/gui/IDisplayEventConnection.h b/include/gui/IDisplayEventConnection.h
index 8728bb5..86247de 100644
--- a/include/gui/IDisplayEventConnection.h
+++ b/include/gui/IDisplayEventConnection.h
@@ -33,9 +33,27 @@ class BitTube;
class IDisplayEventConnection : public IInterface
{
public:
+
DECLARE_META_INTERFACE(DisplayEventConnection);
+ /*
+ * getDataChannel() returns a BitTube where to receive the events from
+ */
virtual sp<BitTube> getDataChannel() const = 0;
+
+ /*
+ * setVsyncRate() sets the vsync event delivery rate. A value of
+ * 1 returns every vsync events. A value of 2 returns every other events,
+ * etc... a value of 0 returns no event unless requestNextVsync() has
+ * been called.
+ */
+ virtual void setVsyncRate(uint32_t count) = 0;
+
+ /*
+ * requestNextVsync() schedules the next vsync event. It has no effect
+ * if the vsync rate is > 0.
+ */
+ virtual void requestNextVsync() = 0; // asynchronous
};
// ----------------------------------------------------------------------------