This commit is contained in:
Benoit Girard 2012-02-08 19:01:21 -05:00
Родитель f470edbef2
Коммит 45f236563b
5 изменённых файлов: 10 добавлений и 38 удалений

Просмотреть файл

@ -48,6 +48,7 @@ import org.mozilla.gecko.gfx.GeckoSoftwareLayerClient;
import org.mozilla.gecko.gfx.IntSize; import org.mozilla.gecko.gfx.IntSize;
import org.mozilla.gecko.gfx.Layer; import org.mozilla.gecko.gfx.Layer;
import org.mozilla.gecko.gfx.LayerController; import org.mozilla.gecko.gfx.LayerController;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.gfx.PlaceholderLayerClient; import org.mozilla.gecko.gfx.PlaceholderLayerClient;
import org.mozilla.gecko.gfx.RectUtils; import org.mozilla.gecko.gfx.RectUtils;
import org.mozilla.gecko.gfx.SurfaceTextureLayer; import org.mozilla.gecko.gfx.SurfaceTextureLayer;

Просмотреть файл

@ -113,7 +113,8 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient {
GeckoAppShell.registerGeckoEventListener("Viewport:UpdateLater", this); GeckoAppShell.registerGeckoEventListener("Viewport:UpdateLater", this);
GeckoAppShell.registerGeckoEventListener("Checkerboard:Toggle", this); GeckoAppShell.registerGeckoEventListener("Checkerboard:Toggle", this);
sendResizeEventIfNecessary(); // XXX: Review pcwalton. This signature changed on m-c, should force = false here?
sendResizeEventIfNecessary(false);
} }
@Override @Override
@ -188,12 +189,6 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient {
originChanged = !origin.equals(oldOrigin); 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 the window size has changed, reallocate the buffer to match.
if (mBufferSize.width != width || mBufferSize.height != height) { if (mBufferSize.width != width || mBufferSize.height != height) {
mBufferSize = new IntSize(width, height); mBufferSize = new IntSize(width, height);
@ -226,9 +221,7 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient {
return; return;
} }
updatedRect.offset(mRenderOffset.x, mRenderOffset.y);
((MultiTileLayer)mTileLayer).invalidate(updatedRect); ((MultiTileLayer)mTileLayer).invalidate(updatedRect);
((MultiTileLayer)mTileLayer).setRenderOffset(mRenderOffset);
} }
private void copyPixelsFromMultiTileLayer(Bitmap target) { private void copyPixelsFromMultiTileLayer(Bitmap target) {

Просмотреть файл

@ -37,10 +37,10 @@
package org.mozilla.gecko.gfx; package org.mozilla.gecko.gfx;
import org.mozilla.gecko.GeckoInputConnection;
import org.mozilla.gecko.gfx.FloatSize; import org.mozilla.gecko.gfx.FloatSize;
import org.mozilla.gecko.gfx.InputConnectionHandler; import org.mozilla.gecko.gfx.InputConnectionHandler;
import org.mozilla.gecko.gfx.LayerController; import org.mozilla.gecko.gfx.LayerController;
import org.mozilla.gecko.GeckoInputConnection;
import org.mozilla.gecko.ui.SimpleScaleGestureDetector; import org.mozilla.gecko.ui.SimpleScaleGestureDetector;
import android.content.Context; import android.content.Context;
import android.opengl.GLSurfaceView; 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 * This view delegates to LayerRenderer to actually do the drawing. Its role is largely that of a
* mediator between the LayerRenderer and the LayerController. * mediator between the LayerRenderer and the LayerController.
*/ */
public class LayerView extends FlexibleGLSurfaceView implements GeckoEventListener { public class LayerView extends FlexibleGLSurfaceView {
public class LayerView extends GLSurfaceView {
private Context mContext; private Context mContext;
private LayerController mController; private LayerController mController;
private InputConnectionHandler mInputConnectionHandler; private InputConnectionHandler mInputConnectionHandler;
@ -93,31 +92,6 @@ public class LayerView extends GLSurfaceView {
setFocusable(true); setFocusable(true);
setFocusableInTouchMode(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) { private void addToEventQueue(MotionEvent event) {

Просмотреть файл

@ -808,6 +808,7 @@ AndroidGeckoSoftwareLayerClient::BeginDrawing(int aWidth, int aHeight, int aTile
void void
AndroidGeckoSoftwareLayerClient::EndDrawing(const nsIntRect &aRect) AndroidGeckoSoftwareLayerClient::EndDrawing(const nsIntRect &aRect)
{
NS_ASSERTION(!isNull(), "EndDrawing() called on null software layer client!"); NS_ASSERTION(!isNull(), "EndDrawing() called on null software layer client!");
JNIEnv *env = AndroidBridge::GetJNIEnv(); JNIEnv *env = AndroidBridge::GetJNIEnv();

Просмотреть файл

@ -844,7 +844,10 @@ nsWindow::BindToTexture()
bool bool
nsWindow::HasDirectTexture() 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 sTestedDirectTexture = false;
static bool sHasDirectTexture = false; static bool sHasDirectTexture = false;