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
commit6779df2c28a68616134b1988f009221652d9f2ad (patch)
tree6e19f621e6306cdbcf49816df648e749dc384838 /include/gui
parent2b621bc5bb52339cc677beb89d0495b8b5d4f444 (diff)
downloadframeworks_base-6779df2c28a68616134b1988f009221652d9f2ad.zip
frameworks_base-6779df2c28a68616134b1988f009221652d9f2ad.tar.gz
frameworks_base-6779df2c28a68616134b1988f009221652d9f2ad.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
};
// ----------------------------------------------------------------------------