summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/MessageQueue.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2017-04-03 13:09:08 -0700
committer Dan Stoza <stoza@google.com> 2017-04-06 11:52:11 -0700
commit6b698e4fe4ff50dcef818452283637f9870ae770 (patch)
treedacce20234785575e8df1446f3ef0f7adc5bad99 /services/surfaceflinger/MessageQueue.cpp
parent7d290174b08a56ae6bc6719bec58805ca38b348b (diff)
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
Diffstat (limited to 'services/surfaceflinger/MessageQueue.cpp')
-rw-r--r--services/surfaceflinger/MessageQueue.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index 6ef26fe3df..bca3430794 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -25,7 +25,6 @@
#include <utils/Log.h>
#include <gui/IDisplayEventConnection.h>
-#include <private/gui/BitTube.h>
#include "MessageQueue.h"
#include "EventThread.h"
@@ -94,8 +93,8 @@ void MessageQueue::setEventThread(const sp<EventThread>& eventThread)
{
mEventThread = eventThread;
mEvents = eventThread->createEventConnection();
- mEvents->getDataChannel(&mEventTube);
- mLooper->addFd(mEventTube->getFd(), 0, Looper::EVENT_INPUT,
+ mEvents->stealReceiveChannel(&mEventTube);
+ mLooper->addFd(mEventTube.getFd(), 0, Looper::EVENT_INPUT,
MessageQueue::cb_eventReceiver, this);
}
@@ -150,7 +149,7 @@ int MessageQueue::cb_eventReceiver(int fd, int events, void* data) {
int MessageQueue::eventReceiver(int /*fd*/, int /*events*/) {
ssize_t n;
DisplayEventReceiver::Event buffer[8];
- while ((n = DisplayEventReceiver::getEvents(mEventTube, buffer, 8)) > 0) {
+ while ((n = DisplayEventReceiver::getEvents(&mEventTube, buffer, 8)) > 0) {
for (int i=0 ; i<n ; i++) {
if (buffer[i].header.type == DisplayEventReceiver::DISPLAY_EVENT_VSYNC) {
mHandler->dispatchInvalidate();