Loading core/java/android/view/DisplayListCanvas.java +12 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ public class DisplayListCanvas extends Canvas { // view hierarchy because display lists are generated recursively. private static final int POOL_LIMIT = 25; private static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB private static final SynchronizedPool<DisplayListCanvas> sPool = new SynchronizedPool<DisplayListCanvas>(POOL_LIMIT); Loading Loading @@ -249,4 +251,14 @@ public class DisplayListCanvas extends Canvas { private static native void nDrawRoundRect(long renderer, long propLeft, long propTop, long propRight, long propBottom, long propRx, long propRy, long propPaint); @Override protected void throwIfCannotDraw(Bitmap bitmap) { super.throwIfCannotDraw(bitmap); int bitmapSize = bitmap.getByteCount(); if (bitmapSize > MAX_BITMAP_SIZE) { throw new RuntimeException( "Canvas: trying to draw too large(" + bitmapSize + "bytes) bitmap."); } } } graphics/java/android/graphics/Canvas.java +1 −1 Original line number Diff line number Diff line Loading @@ -1266,7 +1266,7 @@ public class Canvas { /** * @hide */ protected static void throwIfCannotDraw(Bitmap bitmap) { protected void throwIfCannotDraw(Bitmap bitmap) { if (bitmap.isRecycled()) { throw new RuntimeException("Canvas: trying to use a recycled bitmap " + bitmap); } Loading Loading
core/java/android/view/DisplayListCanvas.java +12 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ public class DisplayListCanvas extends Canvas { // view hierarchy because display lists are generated recursively. private static final int POOL_LIMIT = 25; private static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB private static final SynchronizedPool<DisplayListCanvas> sPool = new SynchronizedPool<DisplayListCanvas>(POOL_LIMIT); Loading Loading @@ -249,4 +251,14 @@ public class DisplayListCanvas extends Canvas { private static native void nDrawRoundRect(long renderer, long propLeft, long propTop, long propRight, long propBottom, long propRx, long propRy, long propPaint); @Override protected void throwIfCannotDraw(Bitmap bitmap) { super.throwIfCannotDraw(bitmap); int bitmapSize = bitmap.getByteCount(); if (bitmapSize > MAX_BITMAP_SIZE) { throw new RuntimeException( "Canvas: trying to draw too large(" + bitmapSize + "bytes) bitmap."); } } }
graphics/java/android/graphics/Canvas.java +1 −1 Original line number Diff line number Diff line Loading @@ -1266,7 +1266,7 @@ public class Canvas { /** * @hide */ protected static void throwIfCannotDraw(Bitmap bitmap) { protected void throwIfCannotDraw(Bitmap bitmap) { if (bitmap.isRecycled()) { throw new RuntimeException("Canvas: trying to use a recycled bitmap " + bitmap); } Loading