Skip to content

Commit 87e8b25

Browse files
chethaaseAndroid (Google) Code Review
authored andcommitted
Merge "Remove redundant computeScroll() call for hw-accelerated views"
2 parents 401b1f8 + 526057b commit 87e8b25

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

core/java/android/view/View.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12922,11 +12922,6 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
1292212922
mPrivateFlags &= ~INVALIDATED;
1292312923
}
1292412924

12925-
computeScroll();
12926-
12927-
final int sx = mScrollX;
12928-
final int sy = mScrollY;
12929-
1293012925
DisplayList displayList = null;
1293112926
Bitmap cache = null;
1293212927
boolean hasDisplayList = false;
@@ -12973,6 +12968,14 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
1297312968
}
1297412969
}
1297512970

12971+
int sx = 0;
12972+
int sy = 0;
12973+
if (!hasDisplayList) {
12974+
computeScroll();
12975+
sx = mScrollX;
12976+
sy = mScrollY;
12977+
}
12978+
1297612979
final boolean hasNoCache = cache == null || hasDisplayList;
1297712980
final boolean offsetForScroll = cache == null && !hasDisplayList &&
1297812981
layerType != LAYER_TYPE_HARDWARE;

0 commit comments

Comments
 (0)