From 6e609bc90f918b16edebb7eca2d409da3d5551c6 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Mon, 4 Jun 2012 13:23:03 -0400 Subject: [PATCH] bug 755070 - Scrolling causes after paint notifications which causes screenshotting which causes checkerboarding, follow up to use LinkedList instead of ArrayDequeu which is not supported on Froyo r=kats --HG-- extra : rebase_source : d10393c4b2f445a6bb26f0a05359843308d84471 --- mobile/android/base/GeckoAppShell.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/GeckoAppShell.java b/mobile/android/base/GeckoAppShell.java index ed64a5c2409..7ca3614ff82 100644 --- a/mobile/android/base/GeckoAppShell.java +++ b/mobile/android/base/GeckoAppShell.java @@ -2105,7 +2105,7 @@ public class GeckoAppShell } class ScreenshotHandler { - private static Queue sPendingScreenshots = new ArrayDeque(); + private static Queue sPendingScreenshots = new LinkedList(); private static RectF sCheckerboardPageRect; private static float sLastCheckerboardWidthRatio, sLastCheckerboardHeightRatio; private static RepaintRunnable sRepaintRunnable = new RepaintRunnable(); @@ -2206,6 +2206,8 @@ class ScreenshotHandler { float sy = viewport.cssPageRectTop; float sw = viewport.cssPageRectRight - viewport.cssPageRectLeft; float sh = viewport.cssPageRectBottom - viewport.cssPageRectTop; + if (sw == 0 || sh == 0) + return; int maxPixels = Math.min(ScreenshotLayer.getMaxNumPixels(), sMaxTextureSize * sMaxTextureSize); // 2Mb of 16bit image data // may be bumped by up to 4x for power of 2 alignment @@ -2231,6 +2233,8 @@ class ScreenshotHandler { static void scheduleCheckerboardScreenshotEvent(int tabId, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int bw, int bh) { float totalSize = sw * sh; int numSlices = (int) Math.ceil(totalSize / 100000); + if (numSlices == 0) + return; int srcSliceSize = (int) Math.ceil(sh / numSlices); int dstSliceSize = (int) Math.ceil(dh / numSlices); for (int i = 0; i < numSlices; i++) {