Merge fixes
authorBenoit Girard <b56girard@gmail.com>
Wed, 08 Feb 2012 19:01:21 -0500
changeset 89101 0e3f830a7a713a3b95b78f73c5f2611c536a6a8d
parent 89100 9281449d3bb581e9e102b48516f6a5dbd5fc36d9
child 89104 76b62081d2412e7fea7870798b8657809c2c3f7e
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
Merge fixes
mobile/android/base/GeckoApp.java
mobile/android/base/gfx/GeckoSoftwareLayerClient.java
mobile/android/base/gfx/LayerView.java
widget/android/AndroidJavaWrappers.cpp
widget/android/nsWindow.cpp
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -43,16 +43,17 @@ package org.mozilla.gecko;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.gfx.FloatSize;
 import org.mozilla.gecko.gfx.GeckoGLLayerClient;
 import org.mozilla.gecko.gfx.GeckoLayerClient;
 import org.mozilla.gecko.gfx.GeckoSoftwareLayerClient;
 import org.mozilla.gecko.gfx.IntSize;
 import org.mozilla.gecko.gfx.Layer;
 import org.mozilla.gecko.gfx.LayerController;
+import org.mozilla.gecko.gfx.LayerView;
 import org.mozilla.gecko.gfx.PlaceholderLayerClient;
 import org.mozilla.gecko.gfx.RectUtils;
 import org.mozilla.gecko.gfx.SurfaceTextureLayer;
 import org.mozilla.gecko.gfx.ViewportMetrics;
 import org.mozilla.gecko.Tab.HistoryEntry;
 
 import java.io.*;
 import java.util.*;
--- a/mobile/android/base/gfx/GeckoSoftwareLayerClient.java
+++ b/mobile/android/base/gfx/GeckoSoftwareLayerClient.java
@@ -108,17 +108,18 @@ public class GeckoSoftwareLayerClient ex
         if (mGeckoViewport != null) {
             layerController.setViewportMetrics(mGeckoViewport);
         }
 
         GeckoAppShell.registerGeckoEventListener("Viewport:UpdateAndDraw", this);
         GeckoAppShell.registerGeckoEventListener("Viewport:UpdateLater", this);
         GeckoAppShell.registerGeckoEventListener("Checkerboard:Toggle", this);
 
-        sendResizeEventIfNecessary();
+        // XXX: Review pcwalton. This signature changed on m-c, should force = false here?
+        sendResizeEventIfNecessary(false);
     }
 
     @Override
     protected boolean handleDirectTextureChange(boolean hasDirectTexture) {
         if (mTileLayer != null && hasDirectTexture == mHasDirectTexture)
             return false;
 
         mHasDirectTexture = hasDirectTexture;
@@ -183,22 +184,16 @@ public class GeckoSoftwareLayerClient ex
         boolean originChanged = true;
         Point origin = PointUtils.round(mNewGeckoViewport.getDisplayportOrigin());
 
         if (mGeckoViewport != null) {
             Point oldOrigin = PointUtils.round(mGeckoViewport.getDisplayportOrigin());
             originChanged = !origin.equals(oldOrigin);
         }
 
-        if (originChanged) {
-            Point tileOrigin = new Point((origin.x / TILE_SIZE.width) * TILE_SIZE.width,
-                                         (origin.y / TILE_SIZE.height) * TILE_SIZE.height);
-            mRenderOffset.set(origin.x - tileOrigin.x, origin.y - tileOrigin.y);
-        }
-
         // If the window size has changed, reallocate the buffer to match.
         if (mBufferSize.width != width || mBufferSize.height != height) {
             mBufferSize = new IntSize(width, height);
 
             // We only need to allocate buffer memory if we're using MultiTileLayer.
             if (!(mTileLayer instanceof MultiTileLayer)) {
                 return true;
             }
@@ -221,19 +216,17 @@ public class GeckoSoftwareLayerClient ex
     }
 
     @Override
     protected void updateLayerAfterDraw(Rect updatedRect) {
         if (!(mTileLayer instanceof MultiTileLayer)) {
             return;
         }
 
-        updatedRect.offset(mRenderOffset.x, mRenderOffset.y);
         ((MultiTileLayer)mTileLayer).invalidate(updatedRect);
-        ((MultiTileLayer)mTileLayer).setRenderOffset(mRenderOffset);
     }
 
     private void copyPixelsFromMultiTileLayer(Bitmap target) {
         Canvas c = new Canvas(target);
         ByteBuffer tileBuffer = mBuffer.slice();
         int bpp = CairoUtils.bitsPerPixelForCairoFormat(mFormat) / 8;
 
         for (int y = 0; y < mBufferSize.height; y += TILE_SIZE.height) {
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -32,20 +32,20 @@
  * 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 org.mozilla.gecko.GeckoInputConnection;
 import org.mozilla.gecko.gfx.FloatSize;
 import org.mozilla.gecko.gfx.InputConnectionHandler;
 import org.mozilla.gecko.gfx.LayerController;
-import org.mozilla.gecko.GeckoInputConnection;
 import org.mozilla.gecko.ui.SimpleScaleGestureDetector;
 import android.content.Context;
 import android.opengl.GLSurfaceView;
 import android.view.View;
 import android.view.GestureDetector;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.inputmethod.EditorInfo;
@@ -57,18 +57,17 @@ import java.nio.IntBuffer;
 import java.util.LinkedList;
 
 /**
  * A view rendered by the layer compositor.
  *
  * This view delegates to LayerRenderer to actually do the drawing. Its role is largely that of a
  * mediator between the LayerRenderer and the LayerController.
  */
-public class LayerView extends FlexibleGLSurfaceView implements GeckoEventListener {
-public class LayerView extends GLSurfaceView {
+public class LayerView extends FlexibleGLSurfaceView {
     private Context mContext;
     private LayerController mController;
     private InputConnectionHandler mInputConnectionHandler;
     private LayerRenderer mRenderer;
     private GestureDetector mGestureDetector;
     private SimpleScaleGestureDetector mScaleGestureDetector;
     private long mRenderTime;
     private boolean mRenderTimeReset;
@@ -88,41 +87,16 @@ public class LayerView extends GLSurface
         mScaleGestureDetector =
             new SimpleScaleGestureDetector(controller.getScaleGestureListener());
         mGestureDetector.setOnDoubleTapListener(controller.getDoubleTapListener());
         mInputConnectionHandler = null;
 
         setFocusable(true);
         setFocusableInTouchMode(true);
 
-        GeckoAppShell.registerGeckoEventListener("Preferences:Data", this);
-        JSONArray jsonPrefs = new JSONArray();
-        jsonPrefs.put(touchEventsPrefName);
-        GeckoEvent event = new GeckoEvent("Preferences:Get", jsonPrefs.toString());
-        GeckoAppShell.sendEventToGecko(event);
-
-        createGLThread();
-    }
-
-    public void handleMessage(String event, JSONObject message) {
-        if (event.equals("Preferences:Data")) {
-            try {
-                JSONArray jsonPrefs = message.getJSONArray("preferences");
-                for (int i = 0; i < jsonPrefs.length(); i++) {
-                    JSONObject jPref = jsonPrefs.getJSONObject(i);
-                    final String prefName = jPref.getString("name");
-                    if (prefName.equals(touchEventsPrefName)) {
-                        touchEventsEnabled = jPref.getBoolean("value");
-                        GeckoAppShell.unregisterGeckoEventListener("Preferences:Data", this);
-                    }
-                }
-            } catch(JSONException ex) {
-                Log.e(LOGTAG, "Error decoding JSON", ex);
-            }
-        }
     }
 
     private void addToEventQueue(MotionEvent event) {
         MotionEvent copy = MotionEvent.obtain(event);
         mEventQueue.add(copy);
     }
 
     public void processEventQueue() {
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -803,16 +803,17 @@ AndroidGeckoSoftwareLayerClient::BeginDr
 
     AndroidBridge::AutoLocalJNIFrame(env, 1);
     jstring jMetadata = env->NewString(nsPromiseFlatString(aMetadata).get(), aMetadata.Length());
     return env->CallBooleanMethod(wrapped_obj, jBeginDrawingMethod, aWidth, aHeight, aTileWidth, aTileHeight, jMetadata, aHasDirectTexture);
 }
 
 void
 AndroidGeckoSoftwareLayerClient::EndDrawing(const nsIntRect &aRect)
+{
     NS_ASSERTION(!isNull(), "EndDrawing() called on null software layer client!");
 
     JNIEnv *env = AndroidBridge::GetJNIEnv();
     if (!env)
         return;
 
     AndroidBridge::AutoLocalJNIFrame(env, 1);
     return env->CallVoidMethod(wrapped_obj, jEndDrawingMethod, aRect.x, aRect.y, aRect.width, aRect.height);
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -839,17 +839,20 @@ void
 nsWindow::BindToTexture()
 {
     sDirectTexture->Bind();
 }
 
 bool
 nsWindow::HasDirectTexture()
 {
-  return false;
+  // XXX: Checking fix me
+  // This is currently causes some crashes so disable it for now
+  if (true)
+    return false;
 
   static bool sTestedDirectTexture = false;
   static bool sHasDirectTexture = false;
 
   // If we already tested, return early
   if (sTestedDirectTexture)
     return sHasDirectTexture;