Update sprite surface when desired width or height changes.

Previously only updating when increasing.

Bug: 331260947
Bug: 305193969
Test: Manual
Flag: ACONFIG com.android.systemui.enable_vector_cursors TRUNKFOOD
Change-Id: I3ae6fb398e31a7b9aca6bfdcc5a39136cc6d85af
diff --git a/libs/input/SpriteController.cpp b/libs/input/SpriteController.cpp
index 6a32c5a..a63453d 100644
--- a/libs/input/SpriteController.cpp
+++ b/libs/input/SpriteController.cpp
@@ -148,8 +148,9 @@
         if (update.state.wantSurfaceVisible()) {
             int32_t desiredWidth = update.state.icon.width();
             int32_t desiredHeight = update.state.icon.height();
-            if (update.state.surfaceWidth < desiredWidth
-                    || update.state.surfaceHeight < desiredHeight) {
+            // TODO(b/331260947): investigate using a larger surface width with smaller sprites.
+            if (update.state.surfaceWidth != desiredWidth ||
+                update.state.surfaceHeight != desiredHeight) {
                 needApplyTransaction = true;
 
                 update.state.surfaceControl->updateDefaultBufferSize(desiredWidth, desiredHeight);