diff options
author | Mathias Agopian <mathias@google.com> | 2011-12-06 17:22:19 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-12-06 22:43:10 -0800 |
commit | 478ae5eb5a0047e1b2988c896cff6363b455ee50 (patch) | |
tree | bb3e26939a6b6a0c0b0b5ab4b12fe4f0dc5d7bf3 /libs/gui/DisplayEventReceiver.cpp | |
parent | 9bbbcf8c65771e581a8bdbe5d1cc70e3faf310ab (diff) | |
download | frameworks_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 'libs/gui/DisplayEventReceiver.cpp')
-rw-r--r-- | libs/gui/DisplayEventReceiver.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp index 3b29a11..fee1feb 100644 --- a/libs/gui/DisplayEventReceiver.cpp +++ b/libs/gui/DisplayEventReceiver.cpp @@ -58,6 +58,26 @@ int DisplayEventReceiver::getFd() const { return mDataChannel->getFd(); } +status_t DisplayEventReceiver::setVsyncRate(uint32_t count) { + if (int32_t(count) < 0) + return BAD_VALUE; + + if (mEventConnection != NULL) { + mEventConnection->setVsyncRate(count); + return NO_ERROR; + } + return NO_INIT; +} + +status_t DisplayEventReceiver::requestNextVsync() { + if (mEventConnection != NULL) { + mEventConnection->requestNextVsync(); + return NO_ERROR; + } + return NO_INIT; +} + + ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events, size_t count) { ssize_t size = mDataChannel->read(events, sizeof(events[0])*count); |