Loading libs/nativedisplay/include/android/choreographer.h→include/android/choreographer.h +9 −5 Original line number Diff line number Diff line Loading @@ -75,14 +75,16 @@ AChoreographer* AChoreographer_getInstance() __INTRODUCED_IN(24); * Deprecated: Use AChoreographer_postFrameCallback64 instead. */ void AChoreographer_postFrameCallback(AChoreographer* choreographer, AChoreographer_frameCallback callback, void* data) __INTRODUCED_IN(24) __DEPRECATED_IN(29); AChoreographer_frameCallback callback, void* data) __INTRODUCED_IN(24) __DEPRECATED_IN(29); /** * Deprecated: Use AChoreographer_postFrameCallbackDelayed64 instead. */ void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer, AChoreographer_frameCallback callback, void* data, long delayMillis) __INTRODUCED_IN(24) __DEPRECATED_IN(29); long delayMillis) __INTRODUCED_IN(24) __DEPRECATED_IN(29); #endif /* __ANDROID_API__ >= 24 */ Loading @@ -95,7 +97,8 @@ void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer, * Available since API level 29. */ void AChoreographer_postFrameCallback64(AChoreographer* choreographer, AChoreographer_frameCallback64 callback, void* data) __INTRODUCED_IN(29); AChoreographer_frameCallback64 callback, void* data) __INTRODUCED_IN(29); /** * Post a callback to be run on the frame following the specified delay. The Loading @@ -105,7 +108,8 @@ void AChoreographer_postFrameCallback64(AChoreographer* choreographer, * Available since API level 29. */ void AChoreographer_postFrameCallbackDelayed64(AChoreographer* choreographer, AChoreographer_frameCallback64 callback, void* data, uint32_t delayMillis) __INTRODUCED_IN(29); AChoreographer_frameCallback64 callback, void* data, uint32_t delayMillis) __INTRODUCED_IN(29); #endif /* __ANDROID_API__ >= 29 */ Loading libs/gui/DisplayEventDispatcher.cpp +3 −10 Original line number Diff line number Diff line Loading @@ -36,10 +36,7 @@ static const size_t EVENT_BUFFER_SIZE = 100; DisplayEventDispatcher::DisplayEventDispatcher(const sp<Looper>& looper, ISurfaceComposer::VsyncSource vsyncSource, ISurfaceComposer::ConfigChanged configChanged) : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false), mConfigChangeFlag(configChanged) { : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false) { ALOGV("dispatcher %p ~ Initializing display event dispatcher.", this); } Loading Loading @@ -92,16 +89,12 @@ status_t DisplayEventDispatcher::scheduleVsync() { return OK; } void DisplayEventDispatcher::toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) { if (mConfigChangeFlag == configChangeFlag) { return; } status_t status = mReceiver.toggleConfigEvents(configChangeFlag); void DisplayEventDispatcher::requestLatestConfig() { status_t status = mReceiver.requestLatestConfig(); if (status) { ALOGW("Failed enable config events, status=%d", status); return; } mConfigChangeFlag = configChangeFlag; } int DisplayEventDispatcher::getFd() const { Loading libs/gui/DisplayEventReceiver.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -79,10 +79,9 @@ status_t DisplayEventReceiver::requestNextVsync() { return NO_INIT; } status_t DisplayEventReceiver::toggleConfigEvents( ISurfaceComposer::ConfigChanged configChangeFlag) { status_t DisplayEventReceiver::requestLatestConfig() { if (mEventConnection != nullptr) { mEventConnection->toggleConfigEvents(configChangeFlag); mEventConnection->requestLatestConfig(); return NO_ERROR; } return NO_INIT; Loading libs/gui/IDisplayEventConnection.cpp +7 −8 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ enum class Tag : uint32_t { STEAL_RECEIVE_CHANNEL = IBinder::FIRST_CALL_TRANSACTION, SET_VSYNC_RATE, REQUEST_NEXT_VSYNC, TOGGLE_CONFIG_EVENTS, LAST = TOGGLE_CONFIG_EVENTS, REQUEST_LATEST_CONFIG, LAST = REQUEST_LATEST_CONFIG, }; } // Anonymous namespace Loading Loading @@ -55,10 +55,9 @@ public: Tag::REQUEST_NEXT_VSYNC); } void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) override { callRemoteAsync<decltype( &IDisplayEventConnection::toggleConfigEvents)>(Tag::TOGGLE_CONFIG_EVENTS, configChangeFlag); void requestLatestConfig() override { callRemoteAsync<decltype(&IDisplayEventConnection::requestLatestConfig)>( Tag::REQUEST_LATEST_CONFIG); } }; Loading @@ -81,8 +80,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); case Tag::REQUEST_LATEST_CONFIG: return callLocalAsync(data, reply, &IDisplayEventConnection::requestLatestConfig); } } Loading libs/gui/include/gui/DisplayEventDispatcher.h +1 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public: status_t initialize(); void dispose(); status_t scheduleVsync(); void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag); void requestLatestConfig(); int getFd() const; virtual int handleEvent(int receiveFd, int events, void* data); Loading @@ -42,7 +42,6 @@ private: sp<Looper> mLooper; DisplayEventReceiver mReceiver; bool mWaitingForVsync; ISurfaceComposer::ConfigChanged mConfigChangeFlag; virtual void dispatchVsync(nsecs_t timestamp, PhysicalDisplayId displayId, uint32_t count) = 0; virtual void dispatchHotplug(nsecs_t timestamp, PhysicalDisplayId displayId, Loading Loading
libs/nativedisplay/include/android/choreographer.h→include/android/choreographer.h +9 −5 Original line number Diff line number Diff line Loading @@ -75,14 +75,16 @@ AChoreographer* AChoreographer_getInstance() __INTRODUCED_IN(24); * Deprecated: Use AChoreographer_postFrameCallback64 instead. */ void AChoreographer_postFrameCallback(AChoreographer* choreographer, AChoreographer_frameCallback callback, void* data) __INTRODUCED_IN(24) __DEPRECATED_IN(29); AChoreographer_frameCallback callback, void* data) __INTRODUCED_IN(24) __DEPRECATED_IN(29); /** * Deprecated: Use AChoreographer_postFrameCallbackDelayed64 instead. */ void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer, AChoreographer_frameCallback callback, void* data, long delayMillis) __INTRODUCED_IN(24) __DEPRECATED_IN(29); long delayMillis) __INTRODUCED_IN(24) __DEPRECATED_IN(29); #endif /* __ANDROID_API__ >= 24 */ Loading @@ -95,7 +97,8 @@ void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer, * Available since API level 29. */ void AChoreographer_postFrameCallback64(AChoreographer* choreographer, AChoreographer_frameCallback64 callback, void* data) __INTRODUCED_IN(29); AChoreographer_frameCallback64 callback, void* data) __INTRODUCED_IN(29); /** * Post a callback to be run on the frame following the specified delay. The Loading @@ -105,7 +108,8 @@ void AChoreographer_postFrameCallback64(AChoreographer* choreographer, * Available since API level 29. */ void AChoreographer_postFrameCallbackDelayed64(AChoreographer* choreographer, AChoreographer_frameCallback64 callback, void* data, uint32_t delayMillis) __INTRODUCED_IN(29); AChoreographer_frameCallback64 callback, void* data, uint32_t delayMillis) __INTRODUCED_IN(29); #endif /* __ANDROID_API__ >= 29 */ Loading
libs/gui/DisplayEventDispatcher.cpp +3 −10 Original line number Diff line number Diff line Loading @@ -36,10 +36,7 @@ static const size_t EVENT_BUFFER_SIZE = 100; DisplayEventDispatcher::DisplayEventDispatcher(const sp<Looper>& looper, ISurfaceComposer::VsyncSource vsyncSource, ISurfaceComposer::ConfigChanged configChanged) : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false), mConfigChangeFlag(configChanged) { : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false) { ALOGV("dispatcher %p ~ Initializing display event dispatcher.", this); } Loading Loading @@ -92,16 +89,12 @@ status_t DisplayEventDispatcher::scheduleVsync() { return OK; } void DisplayEventDispatcher::toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) { if (mConfigChangeFlag == configChangeFlag) { return; } status_t status = mReceiver.toggleConfigEvents(configChangeFlag); void DisplayEventDispatcher::requestLatestConfig() { status_t status = mReceiver.requestLatestConfig(); if (status) { ALOGW("Failed enable config events, status=%d", status); return; } mConfigChangeFlag = configChangeFlag; } int DisplayEventDispatcher::getFd() const { Loading
libs/gui/DisplayEventReceiver.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -79,10 +79,9 @@ status_t DisplayEventReceiver::requestNextVsync() { return NO_INIT; } status_t DisplayEventReceiver::toggleConfigEvents( ISurfaceComposer::ConfigChanged configChangeFlag) { status_t DisplayEventReceiver::requestLatestConfig() { if (mEventConnection != nullptr) { mEventConnection->toggleConfigEvents(configChangeFlag); mEventConnection->requestLatestConfig(); return NO_ERROR; } return NO_INIT; Loading
libs/gui/IDisplayEventConnection.cpp +7 −8 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ enum class Tag : uint32_t { STEAL_RECEIVE_CHANNEL = IBinder::FIRST_CALL_TRANSACTION, SET_VSYNC_RATE, REQUEST_NEXT_VSYNC, TOGGLE_CONFIG_EVENTS, LAST = TOGGLE_CONFIG_EVENTS, REQUEST_LATEST_CONFIG, LAST = REQUEST_LATEST_CONFIG, }; } // Anonymous namespace Loading Loading @@ -55,10 +55,9 @@ public: Tag::REQUEST_NEXT_VSYNC); } void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) override { callRemoteAsync<decltype( &IDisplayEventConnection::toggleConfigEvents)>(Tag::TOGGLE_CONFIG_EVENTS, configChangeFlag); void requestLatestConfig() override { callRemoteAsync<decltype(&IDisplayEventConnection::requestLatestConfig)>( Tag::REQUEST_LATEST_CONFIG); } }; Loading @@ -81,8 +80,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); case Tag::REQUEST_LATEST_CONFIG: return callLocalAsync(data, reply, &IDisplayEventConnection::requestLatestConfig); } } Loading
libs/gui/include/gui/DisplayEventDispatcher.h +1 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public: status_t initialize(); void dispose(); status_t scheduleVsync(); void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag); void requestLatestConfig(); int getFd() const; virtual int handleEvent(int receiveFd, int events, void* data); Loading @@ -42,7 +42,6 @@ private: sp<Looper> mLooper; DisplayEventReceiver mReceiver; bool mWaitingForVsync; ISurfaceComposer::ConfigChanged mConfigChangeFlag; virtual void dispatchVsync(nsecs_t timestamp, PhysicalDisplayId displayId, uint32_t count) = 0; virtual void dispatchHotplug(nsecs_t timestamp, PhysicalDisplayId displayId, Loading