Bug 728622. Remove dead code for dealing with view in Layer.java. r=clord
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 21 Feb 2012 11:05:09 -0500
changeset 92512 ad16a4fbcdc5980a2b3d357cff8f2e15df52fcc3
parent 92511 a442ffe3c5cb459fd11d6e561f6da70bc6245093
child 92513 6cf00c870da2a0915b8831558949d039f5a9c105
push idunknown
push userunknown
push dateunknown
reviewersclord
bugs728622, 727939
milestone13.0a1
Bug 728622. Remove dead code for dealing with view in Layer.java. r=clord Now that bug 727939 has landed we don't seem to have any need to keep the view around.
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/Layer.java
mobile/android/base/gfx/MultiTileLayer.java
mobile/android/base/gfx/PlaceholderLayerClient.java
mobile/android/base/gfx/SurfaceTextureLayer.java
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -180,28 +180,28 @@ public abstract class GeckoLayerClient i
             bufferRect = RectUtils.round(new RectF(currentOrigin.x, currentOrigin.y,
                                                    currentOrigin.x + width, currentOrigin.y + height));
 
 
             // Take the intersection of the two as the area we're interested in rendering.
             if (!bufferRect.intersect(currentRect)) {
                 // If there's no intersection, we have no need to render anything,
                 // but make sure to update the viewport size.
-                mTileLayer.beginTransaction(mLayerController.getView());
+                mTileLayer.beginTransaction();
                 try {
                     updateViewport(true);
                 } finally {
                     mTileLayer.endTransaction();
                 }
                 return null;
             }
             bufferRect.offset(Math.round(-currentOrigin.x), Math.round(-currentOrigin.y));
         }
 
-        mTileLayer.beginTransaction(mLayerController.getView());
+        mTileLayer.beginTransaction();
 
         // Be sure to adjust the buffer size; if it's not at least as large as the viewport size,
         // ViewportMetrics.getOptimumViewportOffset() gets awfully confused and severe display
         // corruption results!
         if (mBufferSize.width != width || mBufferSize.height != height) {
             mBufferSize = new IntSize(width, height);
         }
 
--- a/mobile/android/base/gfx/Layer.java
+++ b/mobile/android/base/gfx/Layer.java
@@ -48,17 +48,16 @@ import java.nio.FloatBuffer;
 import java.util.concurrent.locks.ReentrantLock;
 import org.mozilla.gecko.FloatUtils;
 
 public abstract class Layer {
     private final ReentrantLock mTransactionLock;
     private boolean mInTransaction;
     private Point mNewOrigin;
     private float mNewResolution;
-    private LayerView mView;
 
     protected Point mOrigin;
     protected float mResolution;
 
     public Layer() {
         mTransactionLock = new ReentrantLock();
         mOrigin = new Point(0, 0);
         mResolution = 1.0f;
@@ -110,29 +109,24 @@ public abstract class Layer {
 
     /**
      * Call this before modifying the layer. Note that, for TileLayers, "modifying the layer"
      * includes altering the underlying CairoImage in any way. Thus you must call this function
      * before modifying the byte buffer associated with this layer.
      *
      * This function may block, so you should never call this on the main UI thread.
      */
-    public void beginTransaction(LayerView aView) {
+    public void beginTransaction() {
         if (mTransactionLock.isHeldByCurrentThread())
             throw new RuntimeException("Nested transactions are not supported");
         mTransactionLock.lock();
-        mView = aView;
         mInTransaction = true;
         mNewResolution = mResolution;
     }
 
-    public void beginTransaction() {
-        beginTransaction(null);
-    }
-
     /** Call this when you're done modifying the layer. */
     public void endTransaction() {
         if (!mInTransaction)
             throw new RuntimeException("endTransaction() called outside a transaction");
         mInTransaction = false;
         mTransactionLock.unlock();
     }
 
--- a/mobile/android/base/gfx/MultiTileLayer.java
+++ b/mobile/android/base/gfx/MultiTileLayer.java
@@ -212,17 +212,17 @@ public class MultiTileLayer extends Laye
 
         return (dirtyTiles == 0);
     }
 
     private void refreshTileMetrics(Point origin, float resolution, boolean inTransaction) {
         IntSize size = getSize();
         for (SubTile layer : mTiles) {
             if (!inTransaction) {
-                layer.beginTransaction(null);
+                layer.beginTransaction();
             }
 
             if (origin != null) {
                 layer.setOrigin(new Point(origin.x + layer.x, origin.y + layer.y));
             }
             if (resolution >= 0.0f) {
                 layer.setResolution(resolution);
             }
@@ -241,21 +241,21 @@ public class MultiTileLayer extends Laye
 
     @Override
     public void setResolution(float newResolution) {
         super.setResolution(newResolution);
         refreshTileMetrics(null, newResolution, true);
     }
 
     @Override
-    public void beginTransaction(LayerView aView) {
-        super.beginTransaction(aView);
+    public void beginTransaction() {
+        super.beginTransaction();
 
         for (SubTile layer : mTiles) {
-            layer.beginTransaction(aView);
+            layer.beginTransaction();
         }
     }
 
     @Override
     public void endTransaction() {
         for (SubTile layer : mTiles) {
             layer.endTransaction();
         }
--- a/mobile/android/base/gfx/PlaceholderLayerClient.java
+++ b/mobile/android/base/gfx/PlaceholderLayerClient.java
@@ -82,17 +82,17 @@ public class PlaceholderLayerClient {
 
         if (mViewportUnknown)
             mViewport.setViewport(mLayerController.getViewport());
         mLayerController.setViewportMetrics(mViewport);
 
         BufferedCairoImage image = new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat);
         SingleTileLayer tileLayer = new SingleTileLayer(image);
 
-        tileLayer.beginTransaction(mLayerController.getView());
+        tileLayer.beginTransaction();
         try {
             tileLayer.setOrigin(PointUtils.round(mViewport.getDisplayportOrigin()));
         } finally {
             tileLayer.endTransaction();
         }
 
         mLayerController.setRoot(tileLayer);
     }
--- a/mobile/android/base/gfx/SurfaceTextureLayer.java
+++ b/mobile/android/base/gfx/SurfaceTextureLayer.java
@@ -136,17 +136,17 @@ public class SurfaceTextureLayer extends
         FloatBuffer floatBuffer = byteBuffer.asFloatBuffer();
         floatBuffer.put(input);
 		floatBuffer.position(0);
 
         return floatBuffer;
     }
 
     public void update(Point origin, IntSize size, float resolution, boolean inverted, boolean blend) {
-        beginTransaction(null);
+        beginTransaction();
 
         setOrigin(origin);
         setResolution(resolution);
 
         mNewSize = size;
         mNewInverted = inverted;
         mNewBlend = blend;