Bug 802510 - Reset position on the thumbnail data buffer to the beginning before reading out of it. r=blassey
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 14 Nov 2012 00:34:25 -0800
changeset 113210 250576c9698edce6384ea9dc20a8ac7b5810a4ca
parent 113209 6eeefc8b82c9f1528bcfc6a47d470cab6ddfa7b1
child 113211 24b745c02ce7da5913c8703a85f4b406de4a8654
push id23859
push useremorley@mozilla.com
push dateWed, 14 Nov 2012 14:36:31 +0000
treeherdermozilla-central@87928cd21b40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs802510
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 802510 - Reset position on the thumbnail data buffer to the beginning before reading out of it. r=blassey
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -724,16 +724,17 @@ abstract public class GeckoApp
         int dw = Tabs.getThumbnailWidth();
         int dh = Tabs.getThumbnailHeight();
         GeckoAppShell.sendEventToGecko(GeckoEvent.createScreenshotEvent(tab.getId(), 0, 0, 0, 0, 0, 0, dw, dh, dw, dh, ScreenshotHandler.SCREENSHOT_THUMBNAIL, tab.getThumbnailBuffer()));
     }
 
     void handleThumbnailData(Tab tab, ByteBuffer data) {
         if (shouldUpdateThumbnail(tab)) {
             Bitmap b = tab.getThumbnailBitmap();
+            data.position(0);
             b.copyPixelsFromBuffer(data);
             processThumbnail(tab, b, null);
         }
     }
 
     void processThumbnail(Tab thumbnailTab, Bitmap bitmap, byte[] compressed) {
         try {
             if (bitmap == null) {