From 25a5299d7eaebce137e4cdd5047d0355b205f159 Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Mon, 30 Jan 2012 15:57:30 -0500 Subject: [PATCH] Merge fixes --- config/android-common.mk | 1 - gfx/layers/ipc/CompositorParent.cpp | 4 ---- mobile/android/base/AboutHomeContent.java | 2 +- mobile/android/base/gfx/AbstractLayerView.java | 2 ++ mobile/android/base/gfx/LayerView.java | 8 ++++---- mobile/android/base/gfx/MultiTileLayer.java | 2 +- mobile/android/base/gfx/layers/OGLSurfaceView.java | 3 +++ widget/android/AndroidBridge.cpp | 6 +++++- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/config/android-common.mk b/config/android-common.mk index 25548f561da7..0ce55c3d19dc 100644 --- a/config/android-common.mk +++ b/config/android-common.mk @@ -71,5 +71,4 @@ JAVAC_FLAGS = \ -bootclasspath $(JAVA_BOOTCLASSPATH) \ -encoding UTF8 \ -g \ - -Werror \ $(NULL) diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 2d23dae446ae..caee4a819e1c 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -164,7 +164,6 @@ CompositorParent::DeallocPLayers(PLayersParent* actor) return true; } -<<<<<<< local #ifdef MOZ_WIDGET_ANDROID void CompositorParent::RegisterCompositorWithJava() @@ -173,9 +172,6 @@ CompositorParent::RegisterCompositorWithJava() } #endif - -======= ->>>>>>> other } // namespace layers } // namespace mozilla diff --git a/mobile/android/base/AboutHomeContent.java b/mobile/android/base/AboutHomeContent.java index 9ce9193e7f39..c1fa0f2d01c0 100644 --- a/mobile/android/base/AboutHomeContent.java +++ b/mobile/android/base/AboutHomeContent.java @@ -468,7 +468,7 @@ public class AboutHomeContent extends ScrollView { // If gecko is ready, the session restore initialization has already occurred. // This means sessionstore.js has been moved to sessionstore.bak. Otherwise, the // previous session will still be in sessionstore.js. - final String sessionFilename = "sessionstore." + (GeckoApp.mAppContext.sIsGeckoReady ? "bak" : "js"); + final String sessionFilename = "sessionstore." + (GeckoApp.sIsGeckoReady ? "bak" : "js"); final JSONArray tabs; String jsonString = readJSONFile(activity, sessionFilename); if (jsonString == null) diff --git a/mobile/android/base/gfx/AbstractLayerView.java b/mobile/android/base/gfx/AbstractLayerView.java index 32513482e353..d9da17e2e242 100644 --- a/mobile/android/base/gfx/AbstractLayerView.java +++ b/mobile/android/base/gfx/AbstractLayerView.java @@ -56,5 +56,7 @@ public interface AbstractLayerView { public boolean postDelayed(Runnable action, long delayMillis); public Context getContext(); public int getMaxTextureSize(); + public void clearEventQueue(); + public void processEventQueue(); } diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java index 0c4a431df63b..629c18de9bcf 100644 --- a/mobile/android/base/gfx/LayerView.java +++ b/mobile/android/base/gfx/LayerView.java @@ -69,7 +69,7 @@ import org.json.JSONObject; * mediator between the LayerRenderer and the LayerController. */ public class LayerView extends GLSurfaceView - implements AbstractLayerView { + implements AbstractLayerView, GeckoEventListener { private Context mContext; private LayerController mController; private InputConnectionHandler mInputConnectionHandler; @@ -170,9 +170,9 @@ public class LayerView extends GLSurfaceView } public GeckoInputConnection setInputConnectionHandler() { - mInputConnectionHandler = GeckoInputConnection.create(this); - setInputConnectionHandler(mInputConnectionHandler); - return mInputConnectionHandler; + GeckoInputConnection geckoInputConnection = GeckoInputConnection.create(this); + mInputConnectionHandler = geckoInputConnection; + return geckoInputConnection; } @Override diff --git a/mobile/android/base/gfx/MultiTileLayer.java b/mobile/android/base/gfx/MultiTileLayer.java index 10fb5f112a71..394cb3e9e714 100644 --- a/mobile/android/base/gfx/MultiTileLayer.java +++ b/mobile/android/base/gfx/MultiTileLayer.java @@ -380,7 +380,7 @@ public class MultiTileLayer extends Layer { } @Override - public void beginTransaction(LayerView aView) { + public void beginTransaction(AbstractLayerView aView) { super.beginTransaction(aView); for (SubTile layer : mTiles) { diff --git a/mobile/android/base/gfx/layers/OGLSurfaceView.java b/mobile/android/base/gfx/layers/OGLSurfaceView.java index 717e12be1159..75530d0e82e9 100644 --- a/mobile/android/base/gfx/layers/OGLSurfaceView.java +++ b/mobile/android/base/gfx/layers/OGLSurfaceView.java @@ -43,6 +43,7 @@ import android.view.SurfaceView; import android.util.Log; import android.view.View; +import org.mozilla.gecko.GeckoApp; import org.mozilla.gecko.gfx.*; import org.mozilla.gecko.GeckoInputConnection; @@ -132,6 +133,8 @@ public class OGLSurfaceView implements AbstractLayerView { public boolean postDelayed(Runnable action, long delayMillis) { return false; } public Context getContext() { return mContext; } public int getMaxTextureSize() { return 1024; } + public void clearEventQueue() {} + public void processEventQueue() {} private class InternalSurfaceView extends SurfaceView { public InternalSurfaceView() { diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp index 5370f33770e9..adde22b6b372 100644 --- a/widget/android/AndroidBridge.cpp +++ b/widget/android/AndroidBridge.cpp @@ -975,7 +975,11 @@ void * AndroidBridge::CallEglCreateWindowSurface(void *dpy, void *config, AndroidGeckoSurfaceView &sview) { ALOG_BRIDGE("AndroidBridge::CallEglCreateWindowSurface"); - AutoLocalJNIFrame jniFrame(GetJNIForThread()); + + // Called off the main thread by the compositor + JNIEnv *env = GetJNIForThread(); + if (!env) + return NULL; /* * This is basically: