DO NOT MERGE: revert HWC2 changes
The changes are causing some issues with multi-window use cases.
Fixes: 64491794
Test: test gmail compose in multi-window + show taps enabled
Change-Id: I0b0a3f351ed48f81db89a71c78bf17bab8cb2acf
Signed-off-by: Adrian Salido <salidoa@google.com>
diff --git a/vsyncworker.cpp b/vsyncworker.cpp
index 2177521..ee140cb 100644
--- a/vsyncworker.cpp
+++ b/vsyncworker.cpp
@@ -34,6 +34,7 @@
VSyncWorker::VSyncWorker()
: Worker("vsync", HAL_PRIORITY_URGENT_DISPLAY),
drm_(NULL),
+ procs_(NULL),
display_(-1),
last_timestamp_(-1) {
}
@@ -48,9 +49,9 @@
return InitWorker();
}
-void VSyncWorker::RegisterCallback(std::shared_ptr<VsyncCallback> callback) {
+void VSyncWorker::SetProcs(hwc_procs_t const *procs) {
Lock();
- callback_ = callback;
+ procs_ = procs;
Unlock();
}
@@ -125,8 +126,7 @@
bool enabled = enabled_;
int display = display_;
- std::shared_ptr<VsyncCallback> callback(callback_);
-
+ hwc_procs_t const *procs = procs_;
Unlock();
if (!enabled)
@@ -159,16 +159,16 @@
}
/*
- * There's a race here where a change in callback_ will not take effect until
+ * There's a race here where a change in procs_ will not take effect until
* the next subsequent requested vsync. This is unavoidable since we can't
* call the vsync hook while holding the thread lock.
*
- * We could shorten the race window by caching callback_ right before calling
- * the hook. However, in practice, callback_ is only updated once, so it's not
+ * We could shorten the race window by caching procs_ right before calling
+ * the hook. However, in practice, procs_ is only updated once, so it's not
* worth the overhead.
*/
- if (callback)
- callback->Callback(display, timestamp);
+ if (procs && procs->vsync)
+ procs->vsync(procs, display, timestamp);
last_timestamp_ = timestamp;
}
}