Introduce animated pointer icon for STYLE_WAIT.
Change-Id: I893f8276e09351db6187c553f349008794b95690
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index 6d840db..b6c01d2 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -20,6 +20,7 @@
#include "SpriteController.h"
#include <map>
+#include <vector>
#include <ui/DisplayInfo.h>
#include <input/Input.h>
@@ -30,8 +31,6 @@
#include <utils/String8.h>
#include <gui/DisplayEventReceiver.h>
-#include <SkBitmap.h>
-
namespace android {
/*
@@ -43,6 +42,11 @@
SpriteIcon spotAnchor;
};
+struct PointerAnimation {
+ std::vector<SpriteIcon> animationFrames;
+ nsecs_t durationPerFrame;
+};
+
/*
* Pointer controller policy interface.
*
@@ -59,7 +63,8 @@
public:
virtual void loadPointerResources(PointerResources* outResources) = 0;
- virtual void loadAdditionalMouseResources(std::map<int32_t, SpriteIcon>* outResources) = 0;
+ virtual void loadAdditionalMouseResources(std::map<int32_t, SpriteIcon>* outResources,
+ std::map<int32_t, PointerAnimation>* outAnimationResources) = 0;
virtual int32_t getDefaultPointerIconId() = 0;
};
@@ -98,7 +103,7 @@
const uint32_t* spotIdToIndex, BitSet32 spotIdBits);
virtual void clearSpots();
- void updatePointerShape(int iconId);
+ void updatePointerShape(int32_t iconId);
void setDisplayViewport(int32_t width, int32_t height, int32_t orientation);
void setPointerIcon(const SpriteIcon& icon);
void setInactivityTimeout(InactivityTimeout inactivityTimeout);
@@ -145,6 +150,9 @@
bool animationPending;
nsecs_t animationTime;
+ size_t animationFrameIndex;
+ nsecs_t lastFrameUpdatedTime;
+
int32_t displayWidth;
int32_t displayHeight;
int32_t displayOrientation;
@@ -162,7 +170,8 @@
SpriteIcon pointerIcon;
bool pointerIconChanged;
- std::map<int, SpriteIcon> additionalMouseResources;
+ std::map<int32_t, SpriteIcon> additionalMouseResources;
+ std::map<int32_t, PointerAnimation> animationResources;
int32_t requestedPointerShape;
@@ -178,6 +187,8 @@
void handleMessage(const Message& message);
int handleEvent(int fd, int events, void* data);
void doAnimate(nsecs_t timestamp);
+ bool doFadingAnimationLocked(nsecs_t timestamp);
+ bool doBitmapAnimationLocked(nsecs_t timestamp);
void doInactivityTimeout();
void startAnimationLocked();