OSDN Git Service

Perform a long computation to catch bitmap sizes > 32 bits
authorRomain Guy <romainguy@google.com>
Sun, 30 Sep 2012 17:49:15 +0000 (10:49 -0700)
committerRomain Guy <romainguy@google.com>
Sun, 30 Sep 2012 18:26:39 +0000 (11:26 -0700)
Bug #7257930

Change-Id: I28d08024fabe8103251d480524b0b0f2fd2d2aba

core/java/android/view/View.java

index 1c12738..0cbce89 100644 (file)
@@ -12819,8 +12819,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
             final boolean opaque = drawingCacheBackgroundColor != 0 || isOpaque();
             final boolean use32BitCache = attachInfo != null && attachInfo.mUse32BitDrawingCache;
 
-            final int projectedBitmapSize = width * height * (opaque && !use32BitCache ? 2 : 4);
-            final int drawingCacheSize =
+            final long projectedBitmapSize = width * height * (opaque && !use32BitCache ? 2 : 4);
+            final long drawingCacheSize =
                     ViewConfiguration.get(mContext).getScaledMaximumDrawingCacheSize();
             if (width <= 0 || height <= 0 || projectedBitmapSize > drawingCacheSize) {
                 if (width > 0 && height > 0) {