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/DispSync.h b/services/surfaceflinger/DispSync.h
index d066d55..9336f4d 100644
--- a/services/surfaceflinger/DispSync.h
+++ b/services/surfaceflinger/DispSync.h
@@ -48,7 +48,7 @@
// needed.
class DispSync {
public:
- class Callback : public virtual RefBase {
+ class Callback {
public:
virtual ~Callback(){};
virtual void onDispSyncEvent(nsecs_t when) = 0;
@@ -106,12 +106,12 @@
// given phase offset from the hardware vsync events. The callback is
// called from a separate thread and it should return reasonably quickly
// (i.e. within a few hundred microseconds).
- status_t addEventListener(const char* name, nsecs_t phase, const sp<Callback>& callback);
+ status_t addEventListener(const char* name, nsecs_t phase, Callback* callback);
// removeEventListener removes an already-registered event callback. Once
// this method returns that callback will no longer be called by the
// DispSync object.
- status_t removeEventListener(const sp<Callback>& callback);
+ status_t removeEventListener(Callback* callback);
// computeNextRefresh computes when the next refresh is expected to begin.
// The periodOffset value can be used to move forward or backward; an
@@ -188,6 +188,8 @@
// Ignore present (retire) fences if the device doesn't have support for the
// sync framework
bool mIgnorePresentFences;
+
+ std::unique_ptr<Callback> mZeroPhaseTracer;
};
} // namespace android