diff options
Diffstat (limited to 'native/android/choreographer.cpp')
-rw-r--r-- | native/android/choreographer.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/native/android/choreographer.cpp b/native/android/choreographer.cpp index c3629da1cb12..2db575bf5a13 100644 --- a/native/android/choreographer.cpp +++ b/native/android/choreographer.cpp @@ -24,6 +24,7 @@ #include <android/choreographer.h> #include <androidfw/DisplayEventDispatcher.h> #include <gui/ISurfaceComposer.h> +#include <gui/SurfaceComposerClient.h> #include <utils/Looper.h> #include <utils/Mutex.h> #include <utils/Timers.h> @@ -67,8 +68,8 @@ private: explicit Choreographer(const sp<Looper>& looper); Choreographer(const Choreographer&) = delete; - virtual void dispatchVsync(nsecs_t timestamp, int32_t id, uint32_t count); - virtual void dispatchHotplug(nsecs_t timestamp, int32_t id, bool connected); + void dispatchVsync(nsecs_t timestamp, PhysicalDisplayId displayId, uint32_t count) override; + void dispatchHotplug(nsecs_t timestamp, PhysicalDisplayId displayId, bool connected) override; void scheduleCallbacks(); @@ -139,13 +140,10 @@ void Choreographer::scheduleCallbacks() { } } - -void Choreographer::dispatchVsync(nsecs_t timestamp, int32_t id, uint32_t) { - if (id != ISurfaceComposer::eDisplayIdMain) { - ALOGV("choreographer %p ~ ignoring vsync signal for non-main display (id=%d)", this, id); - scheduleVsync(); - return; - } +// TODO(b/74619554): The PhysicalDisplayId is ignored because SF only emits VSYNC events for the +// internal display and DisplayEventReceiver::requestNextVsync only allows requesting VSYNC for +// the internal display implicitly. +void Choreographer::dispatchVsync(nsecs_t timestamp, PhysicalDisplayId, uint32_t) { std::vector<FrameCallback> callbacks{}; { AutoMutex _l{mLock}; @@ -160,9 +158,10 @@ void Choreographer::dispatchVsync(nsecs_t timestamp, int32_t id, uint32_t) { } } -void Choreographer::dispatchHotplug(nsecs_t, int32_t id, bool connected) { - ALOGV("choreographer %p ~ received hotplug event (id=%" PRId32 ", connected=%s), ignoring.", - this, id, toString(connected)); +void Choreographer::dispatchHotplug(nsecs_t, PhysicalDisplayId displayId, bool connected) { + ALOGV("choreographer %p ~ received hotplug event (displayId=%" + ANDROID_PHYSICAL_DISPLAY_ID_FORMAT ", connected=%s), ignoring.", + this, displayId, toString(connected)); } void Choreographer::handleMessage(const Message& message) { |