Mouse pointer tweaks.
Make pointer arrow brighter.
Deep copy the pointer icon bitmap since it turns out that the
original shared pixels can be deleted by other code.
Change-Id: I77fbf61d1dace723f3c8c9808941e9e31d8db352
diff --git a/services/input/PointerController.cpp b/services/input/PointerController.cpp
index ebc58ee..92af51e 100644
--- a/services/input/PointerController.cpp
+++ b/services/input/PointerController.cpp
@@ -310,8 +310,16 @@
void PointerController::setPointerIcon(const SkBitmap* bitmap, float hotSpotX, float hotSpotY) {
AutoMutex _l(mLock);
- delete mLocked.iconBitmap;
- mLocked.iconBitmap = bitmap ? new SkBitmap(*bitmap) : NULL;
+ if (mLocked.iconBitmap) {
+ delete mLocked.iconBitmap;
+ mLocked.iconBitmap = NULL;
+ }
+
+ if (bitmap) {
+ mLocked.iconBitmap = new SkBitmap();
+ bitmap->copyTo(mLocked.iconBitmap, SkBitmap::kARGB_8888_Config);
+ }
+
mLocked.iconHotSpotX = hotSpotX;
mLocked.iconHotSpotY = hotSpotY;
mLocked.drawn = false;