libgui: Remove RefBase from BitTube
Removes RefBase from BitTube, since because it is not a Binder object,
it doesn't need to be reference-counted in this way.
In the process, we rename IDisplayEventConnection::getDataChannel to
IDEC::stealReceiveChannel to make it clearer that this is a non-const
operation on the remote end that removes its access to the receive
channel.
This also adds a couple of methods for moving the receive file
descriptor out of one BitTube and into another, since this is the
essence of the IDisplayEventConnection::stealReceiveChannel method,
and now with C++11 move semantics, we can do this without needing to
return an sp<> from EventThread's implementation of stealReceiveChannel.
Test: m -j + manual testing
Change-Id: Ibaaca2a14fb6155052fe5434c14bc3e671b43743
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
index 3e05749..6a59fbb 100644
--- a/services/surfaceflinger/EventThread.h
+++ b/services/surfaceflinger/EventThread.h
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <sys/types.h>
+#include <private/gui/BitTube.h>
#include <gui/DisplayEventReceiver.h>
#include <gui/IDisplayEventConnection.h>
@@ -68,11 +69,11 @@
private:
virtual ~Connection();
virtual void onFirstRef();
- status_t getDataChannel(sp<gui::BitTube>* outChannel) const override;
+ status_t stealReceiveChannel(gui::BitTube* outChannel) override;
status_t setVsyncRate(uint32_t count) override;
void requestNextVsync() override; // asynchronous
sp<EventThread> const mEventThread;
- sp<gui::BitTube> const mChannel;
+ gui::BitTube mChannel;
};
public: