Merge "Remove redundant computeScroll() call for hw-accelerated views"
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 6819f8b..3f017b4 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -12922,11 +12922,6 @@
             mPrivateFlags &= ~INVALIDATED;
         }
 
-        computeScroll();
-
-        final int sx = mScrollX;
-        final int sy = mScrollY;
-
         DisplayList displayList = null;
         Bitmap cache = null;
         boolean hasDisplayList = false;
@@ -12973,6 +12968,14 @@
             }
         }
 
+        int sx = 0;
+        int sy = 0;
+        if (!hasDisplayList) {
+            computeScroll();
+            sx = mScrollX;
+            sy = mScrollY;
+        }
+
         final boolean hasNoCache = cache == null || hasDisplayList;
         final boolean offsetForScroll = cache == null && !hasDisplayList &&
                 layerType != LAYER_TYPE_HARDWARE;