From 67bc14415dd574218fbe6bd3a5167d772e1a3ded Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Wed, 8 Feb 2012 19:01:21 -0500 Subject: [PATCH] Merge fixes --- mobile/android/base/GeckoApp.java | 1 + .../base/gfx/GeckoSoftwareLayerClient.java | 11 ++----- mobile/android/base/gfx/LayerView.java | 30 ++----------------- widget/android/AndroidJavaWrappers.cpp | 1 + widget/android/nsWindow.cpp | 5 +++- 5 files changed, 10 insertions(+), 38 deletions(-) diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 662cbad63fc..04870db5628 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -48,6 +48,7 @@ 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; diff --git a/mobile/android/base/gfx/GeckoSoftwareLayerClient.java b/mobile/android/base/gfx/GeckoSoftwareLayerClient.java index d62dc0aa839..8378f3ae765 100644 --- a/mobile/android/base/gfx/GeckoSoftwareLayerClient.java +++ b/mobile/android/base/gfx/GeckoSoftwareLayerClient.java @@ -113,7 +113,8 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient { 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 @@ -188,12 +189,6 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient { 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); @@ -226,9 +221,7 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient { return; } - updatedRect.offset(mRenderOffset.x, mRenderOffset.y); ((MultiTileLayer)mTileLayer).invalidate(updatedRect); - ((MultiTileLayer)mTileLayer).setRenderOffset(mRenderOffset); } private void copyPixelsFromMultiTileLayer(Bitmap target) { diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java index 6af96e50587..ee3562d7ecf 100644 --- a/mobile/android/base/gfx/LayerView.java +++ b/mobile/android/base/gfx/LayerView.java @@ -37,10 +37,10 @@ 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; @@ -62,8 +62,7 @@ import java.util.LinkedList; * 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; @@ -93,31 +92,6 @@ public class LayerView extends GLSurfaceView { 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) { diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index eca569d750f..fb422903977 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -808,6 +808,7 @@ AndroidGeckoSoftwareLayerClient::BeginDrawing(int aWidth, int aHeight, int aTile void AndroidGeckoSoftwareLayerClient::EndDrawing(const nsIntRect &aRect) +{ NS_ASSERTION(!isNull(), "EndDrawing() called on null software layer client!"); JNIEnv *env = AndroidBridge::GetJNIEnv(); diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 3fdc8beda60..8b0ed5240a4 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -844,7 +844,10 @@ nsWindow::BindToTexture() 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;