bug 706383 - Save screenshot in bundle, adjust indentation r=dougt
authorBrad Lassey <blassey@mozilla.com>
Wed, 30 Nov 2011 21:31:41 -0500
changeset 83653 56fe51d0023cdd815c5ca3c03a0f8d2fc3e87ae6
parent 83652 24f415e415f2a25158a315a8962e0e5ec36ea93a
child 83654 d71c91775f9b698140e7ed2fddd1f1b15f8aa64e
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs706383
milestone11.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 706383 - Save screenshot in bundle, adjust indentation r=dougt
mobile/android/base/gfx/PlaceholderLayerClient.java
--- a/mobile/android/base/gfx/PlaceholderLayerClient.java
+++ b/mobile/android/base/gfx/PlaceholderLayerClient.java
@@ -97,52 +97,52 @@ public class PlaceholderLayerClient exte
     public void destroy() {
         if (mBuffer != null) {
             GeckoAppShell.freeDirectBuffer(mBuffer);
             mBuffer = null;
         }
     }
 
     boolean loadScreenshot() {
-            if (GeckoApp.mAppContext.mLastScreen == null)
-                return false;
-            Bitmap bitmap = BitmapFactory.decodeStream(new ByteArrayInputStream(GeckoApp.mAppContext.mLastScreen));
-            if (bitmap == null)
-                return false;
+        if (GeckoApp.mAppContext.mLastScreen == null)
+            return false;
+        Bitmap bitmap = BitmapFactory.decodeStream(new ByteArrayInputStream(GeckoApp.mAppContext.mLastScreen));
+        if (bitmap == null)
+            return false;
 
-            Bitmap.Config config = bitmap.getConfig();
-
-            mWidth = bitmap.getWidth();
-            mHeight = bitmap.getHeight();
-            mFormat = CairoUtils.bitmapConfigToCairoFormat(config);
+        Bitmap.Config config = bitmap.getConfig();
 
-            int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat) / 8;
-            mBuffer = GeckoAppShell.allocateDirectBuffer(mWidth * mHeight * bpp);
+        mWidth = bitmap.getWidth();
+        mHeight = bitmap.getHeight();
+        mFormat = CairoUtils.bitmapConfigToCairoFormat(config);
 
-            bitmap.copyPixelsToBuffer(mBuffer.asIntBuffer());
+        int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat) / 8;
+        mBuffer = GeckoAppShell.allocateDirectBuffer(mWidth * mHeight * bpp);
 
-            if (mViewportUnknown) {
-                mViewport.setPageSize(new FloatSize(mWidth, mHeight));
-                if (getLayerController() != null)
-                    getLayerController().setPageSize(mViewport.getPageSize());
-            }
+        bitmap.copyPixelsToBuffer(mBuffer.asIntBuffer());
 
-            return true;
+        if (mViewportUnknown) {
+            mViewport.setPageSize(new FloatSize(mWidth, mHeight));
+            if (getLayerController() != null)
+                getLayerController().setPageSize(mViewport.getPageSize());
         }
 
+        return true;
+    }
+
     void showScreenshot() {
-            BufferedCairoImage image = new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat);
-            SingleTileLayer tileLayer = new SingleTileLayer(image);
+        BufferedCairoImage image = new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat);
+        SingleTileLayer tileLayer = new SingleTileLayer(image);
 
-            beginTransaction(tileLayer);
-            tileLayer.setOrigin(PointUtils.round(mViewport.getDisplayportOrigin()));
-            endTransaction(tileLayer);
+        beginTransaction(tileLayer);
+        tileLayer.setOrigin(PointUtils.round(mViewport.getDisplayportOrigin()));
+        endTransaction(tileLayer);
 
-            getLayerController().setRoot(tileLayer);
-        }
+        getLayerController().setRoot(tileLayer);
+    }
 
     @Override
     public void geometryChanged() { /* no-op */ }
     @Override
     public void render() { /* no-op */ }
 
     @Override
     public void setLayerController(LayerController layerController) {