SF: Cleanup EventThread Part 2
De-refbase EventThread and a bunch of related classes. Convert from
usign StrongPointer to std::unique_ptr to hold owned references, or bare
pointers for unowned references.
I did not see any need for using std::shared_ptr, or anything else, as
SurfaceFlinger appeared to own all the objects, and they were created
once and not really destroyed afterwards.
Test: Things seem to still work on a Pixel XL
Bug: None
Change-Id: Ifff32118d31bc1bb51e38df695ebe5cf86d2bb6d
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index 2cbc59e..53d95e2 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -43,7 +43,7 @@
// ---------------------------------------------------------------------------
-EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bool interceptVSyncs,
+EventThread::EventThread(VSyncSource* src, SurfaceFlinger& flinger, bool interceptVSyncs,
const char* threadName)
: mVSyncSource(src), mFlinger(flinger), mInterceptVSyncs(interceptVSyncs) {
for (auto& event : mVSyncEvent) {
@@ -339,7 +339,7 @@
// never enable h/w VSYNC when screen is off
if (!mVsyncEnabled) {
mVsyncEnabled = true;
- mVSyncSource->setCallback(static_cast<VSyncSource::Callback*>(this));
+ mVSyncSource->setCallback(this);
mVSyncSource->setVSyncEnabled(true);
}
}
@@ -370,7 +370,7 @@
// ---------------------------------------------------------------------------
-EventThread::Connection::Connection(const sp<EventThread>& eventThread)
+EventThread::Connection::Connection(EventThread* eventThread)
: count(-1), mEventThread(eventThread), mChannel(gui::BitTube::DefaultSize) {}
EventThread::Connection::~Connection() {