Skip to content

Commit 5a5dc1c

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Use the actual screen size for the max bitmap cache size."
2 parents c419610 + 887c2ee commit 5a5dc1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/java/android/view/ViewConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,9 @@ private ViewConfiguration(Context context) {
305305
mScaledTouchExplorationTapSlop = (int) (density * TOUCH_EXPLORATION_TAP_SLOP + 0.5f);
306306
mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);
307307

308+
final Display display = WindowManagerImpl.getDefault().getDefaultDisplay();
308309
// Size of the screen in bytes, in ARGB_8888 format
309-
mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels;
310+
mMaximumDrawingCacheSize = 4 * display.getRawWidth() * display.getRawHeight();
310311

311312
mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f);
312313
mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f);

0 commit comments

Comments
 (0)