Bring DisplayEventReceiver to PointerController.
Now the fading animation of pointers is handled at vsync.
Change-Id: I10fe27d9d7a0d46c4e6504ca487e80bb56e2fd98
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index 24a1681..6d840db 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -28,6 +28,7 @@
#include <utils/RefBase.h>
#include <utils/Looper.h>
#include <utils/String8.h>
+#include <gui/DisplayEventReceiver.h>
#include <SkBitmap.h>
@@ -68,7 +69,8 @@
*
* Handles pointer acceleration and animation.
*/
-class PointerController : public PointerControllerInterface, public MessageHandler {
+class PointerController : public PointerControllerInterface, public MessageHandler,
+ public LooperCallback {
protected:
virtual ~PointerController();
@@ -106,7 +108,6 @@
static const size_t MAX_SPOTS = 12;
enum {
- MSG_ANIMATE,
MSG_INACTIVITY_TIMEOUT,
};
@@ -136,6 +137,8 @@
sp<SpriteController> mSpriteController;
sp<WeakMessageHandler> mHandler;
+ DisplayEventReceiver mDisplayEventReceiver;
+
PointerResources mResources;
struct Locked {
@@ -173,7 +176,8 @@
void setPositionLocked(float x, float y);
void handleMessage(const Message& message);
- void doAnimate();
+ int handleEvent(int fd, int events, void* data);
+ void doAnimate(nsecs_t timestamp);
void doInactivityTimeout();
void startAnimationLocked();