summaryrefslogtreecommitdiff
path: root/libs/gui/IDisplayEventConnection.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2019-10-28 16:18:59 -0700
committer Alec Mouri <alecmouri@google.com> 2019-12-26 10:28:47 -0800
commit60aee1c46b52852e140f05748f69e38f4e3de36e (patch)
tree7a29657039f1f8911fdef5689aa39e7fd4f3f6bd /libs/gui/IDisplayEventConnection.cpp
parent516de508aa52a0907a496890dc191501481bca7b (diff)
[AChoreographer] Add refresh rate callback.
This will augment the NDK to respond to display events where the display refresh rate changes. Consumers of this api will include: * HWUI, for implementing a policy for determining whether to use render-ahead, * Swappy, to potentially replace jumping into Java from native code to respond to display evnets there. * Any other native app that would rely on the up-to-date display refresh rate. Currently however this is not yet exposed to NDK as CTS is not yet written. Once CTS is written then this will be formally exposed to NDK. For now we'll leave these as APEX apis to represent incremental progress. Bug: 136262896 Test: builds Change-Id: I66d393f93eb5d681547411e330ef1b8950a35c5d
Diffstat (limited to 'libs/gui/IDisplayEventConnection.cpp')
-rw-r--r--libs/gui/IDisplayEventConnection.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/gui/IDisplayEventConnection.cpp b/libs/gui/IDisplayEventConnection.cpp
index c0e246fa15..dda5acf8a7 100644
--- a/libs/gui/IDisplayEventConnection.cpp
+++ b/libs/gui/IDisplayEventConnection.cpp
@@ -26,7 +26,8 @@ enum class Tag : uint32_t {
STEAL_RECEIVE_CHANNEL = IBinder::FIRST_CALL_TRANSACTION,
SET_VSYNC_RATE,
REQUEST_NEXT_VSYNC,
- LAST = REQUEST_NEXT_VSYNC,
+ TOGGLE_CONFIG_EVENTS,
+ LAST = TOGGLE_CONFIG_EVENTS,
};
} // Anonymous namespace
@@ -53,6 +54,12 @@ public:
callRemoteAsync<decltype(&IDisplayEventConnection::requestNextVsync)>(
Tag::REQUEST_NEXT_VSYNC);
}
+
+ void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) override {
+ callRemoteAsync<decltype(
+ &IDisplayEventConnection::toggleConfigEvents)>(Tag::TOGGLE_CONFIG_EVENTS,
+ configChangeFlag);
+ }
};
// Out-of-line virtual method definition to trigger vtable emission in this translation unit (see
@@ -74,6 +81,8 @@ status_t BnDisplayEventConnection::onTransact(uint32_t code, const Parcel& data,
return callLocal(data, reply, &IDisplayEventConnection::setVsyncRate);
case Tag::REQUEST_NEXT_VSYNC:
return callLocalAsync(data, reply, &IDisplayEventConnection::requestNextVsync);
+ case Tag::TOGGLE_CONFIG_EVENTS:
+ return callLocalAsync(data, reply, &IDisplayEventConnection::toggleConfigEvents);
}
}