Take out the empty GeckoLayerClient.dimensionsChanged method and the unneeded support architecture for it
☠☠ backed out by f405525ac6cb ☠ ☠
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 Feb 2012 10:09:38 -0500
changeset 89226 c8451607557be802afca5e89b91575e4c998497c
parent 89225 15e3fc38103fa0a88eed6803fb4e11f0eb753902
child 89227 b61ec8e28c62f707b4a7deb1d94abd5f25625159
child 89228 f405525ac6cbbde48687bb0c04752ed36d58c191
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone13.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
Take out the empty GeckoLayerClient.dimensionsChanged method and the unneeded support architecture for it
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/Layer.java
mobile/android/base/gfx/VirtualLayer.java
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -55,18 +55,17 @@ import android.graphics.RectF;
 import android.os.SystemClock;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.View;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 public class GeckoLayerClient implements GeckoEventListener,
-                                         FlexibleGLSurfaceView.Listener,
-                                         VirtualLayer.Listener {
+                                         FlexibleGLSurfaceView.Listener {
     private static final String LOGTAG = "GeckoLayerClient";
 
     private LayerController mLayerController;
     private LayerRenderer mLayerRenderer;
     private boolean mLayerRendererInitialized;
 
     private IntSize mScreenSize;
     private IntSize mWindowSize;
@@ -116,18 +115,16 @@ public class GeckoLayerClient implements
         }
 
         GeckoAppShell.registerGeckoEventListener("Viewport:UpdateAndDraw", this);
         GeckoAppShell.registerGeckoEventListener("Viewport:UpdateLater", this);
 
         sendResizeEventIfNecessary(false);
 
         LayerView view = layerController.getView();
-        view.setListener(this);
-
         mLayerRenderer = new LayerRenderer(view);
     }
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature. */
     public Rect beginDrawing(int width, int height, int tileWidth, int tileHeight,
                              String metadata, boolean hasDirectTexture) {
         Log.e(LOGTAG, "### beginDrawing " + width + " " + height + " " + tileWidth + " " +
               tileHeight + " " + hasDirectTexture);
@@ -321,17 +318,16 @@ public class GeckoLayerClient implements
 
     private boolean handleDirectTextureChange(boolean hasDirectTexture) {
         if (mTileLayer != null) {
             return false;
         }
 
         Log.e(LOGTAG, "### Creating virtual layer");
         VirtualLayer virtualLayer = new VirtualLayer();
-        virtualLayer.setListener(this);
         virtualLayer.setSize(getBufferSize());
         mLayerController.setRoot(virtualLayer);
         mTileLayer = virtualLayer;
 
         sendResizeEventIfNecessary(true);
         return true;
     }
 
@@ -491,21 +487,16 @@ public class GeckoLayerClient implements
     /** Implementation of FlexibleGLSurfaceView.Listener */
     public void surfaceChanged(int width, int height) {
         compositionPauseRequested();
         mLayerController.setViewportSize(new FloatSize(width, height));
         compositionResumeRequested();
         renderRequested();
     }
 
-    /** Implementation of VirtualLayer.Listener */
-    public void dimensionsChanged(Point newOrigin, float newResolution) {
-        Log.e(LOGTAG, "### dimensionsChanged " + newOrigin + " " + newResolution);
-    }
-
     /** Used by robocop for testing purposes. Not for production use! This is called via reflection by robocop. */
     public void setDrawListener(DrawListener listener) {
         mDrawListener = listener;
     }
 
     /** Used by robocop for testing purposes. Not for production use! This is used via reflection by robocop. */
     public interface DrawListener {
         public void drawFinished(int x, int y, int width, int height);
--- a/mobile/android/base/gfx/Layer.java
+++ b/mobile/android/base/gfx/Layer.java
@@ -177,20 +177,16 @@ public abstract class Layer {
         if (mNewResolution != 0.0f) {
             mResolution = mNewResolution;
             mNewResolution = 0.0f;
         }
 
         return true;
     }
 
-    protected boolean dimensionChangesPending() {
-        return (mNewOrigin != null) || (mNewResolution != 0.0f);
-    }
-
     public static class RenderContext {
         public final RectF viewport;
         public final FloatSize pageSize;
         public final float zoomFactor;
         public final int positionHandle;
         public final int textureHandle;
         public final FloatBuffer coordBuffer;
 
--- a/mobile/android/base/gfx/VirtualLayer.java
+++ b/mobile/android/base/gfx/VirtualLayer.java
@@ -33,48 +33,26 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 package org.mozilla.gecko.gfx;
 
-import android.graphics.Point;
-
 public class VirtualLayer extends Layer {
-    private Listener mListener;
     private IntSize mSize;
 
-    public void setListener(Listener listener) {
-        mListener = listener;
-    }
-
     @Override
     public void draw(RenderContext context) {
         // No-op.
     }
 
     @Override
     public IntSize getSize() {
         return mSize;
     }
 
     public void setSize(IntSize size) {
         mSize = size;
     }
-
-    @Override
-    protected boolean performUpdates(RenderContext context) {
-        boolean dimensionsChanged = dimensionChangesPending();
-        boolean result = super.performUpdates(context);
-        if (dimensionsChanged && mListener != null) {
-            mListener.dimensionsChanged(getOrigin(), getResolution());
-        }
-
-        return result;
-    }
-
-    public interface Listener {
-        void dimensionsChanged(Point newOrigin, float newResolution);
-    }
 }