Bug 777075 - Remove notifyLayerClientOfGeometryChange from the PanZoomTarget interface by baking it into setViewportMetrics and setForceRedraw. r=mbrubeck

This commit is contained in:
Kartikaya Gupta 2012-08-01 10:38:30 -04:00
parent 7eaf38a762
commit f24402c6c9
4 changed files with 6 additions and 21 deletions

View File

@ -543,7 +543,7 @@ public class GeckoAppShell
final LayerController layerController = GeckoApp.mAppContext.getLayerController();
LayerView v = layerController.getView();
mInputConnection = v.setInputConnectionHandler();
layerController.notifyLayerClientOfGeometryChange();
layerController.setForceRedraw();
}
static void sendPendingEventsToGecko() {

View File

@ -89,6 +89,7 @@ public class LayerController implements PanZoomTarget {
public void setForceRedraw() {
mForceRedraw = true;
notifyLayerClientOfGeometryChange();
}
public Layer getRoot() { return mRootLayer; }
@ -161,14 +162,13 @@ public class LayerController implements PanZoomTarget {
}
/**
* Sets the entire viewport metrics at once. This function does not notify the layer client or
* the pan/zoom controller, so you will need to call notifyLayerClientOfGeometryChange() or
* notifyPanZoomControllerOfGeometryChange() after calling this. You must hold the monitor
* while calling this.
* Sets the entire viewport metrics at once.
* You must hold the monitor while calling this.
*/
public void setViewportMetrics(ViewportMetrics viewport) {
mViewportMetrics = new ImmutableViewportMetrics(viewport);
mView.requestRender();
notifyLayerClientOfGeometryChange();
}
public void setAnimationTarget(ViewportMetrics viewport) {
@ -185,11 +185,7 @@ public class LayerController implements PanZoomTarget {
public boolean post(Runnable action) { return mView.post(action); }
/**
* The view as well as the controller itself use this method to notify the layer client that
* the geometry changed.
*/
public void notifyLayerClientOfGeometryChange() {
private void notifyLayerClientOfGeometryChange() {
if (mLayerClient != null)
mLayerClient.geometryChanged();
}

View File

@ -283,7 +283,6 @@ public class PanZoomController
// transitions.
synchronized (mTarget.getLock()) {
mTarget.setViewportMetrics(getValidViewportMetrics());
mTarget.notifyLayerClientOfGeometryChange();
}
break;
}
@ -321,7 +320,6 @@ public class PanZoomController
// page size changed such that we are now in overscroll. snap to the
// the nearest valid viewport
mTarget.setViewportMetrics(validated);
mTarget.notifyLayerClientOfGeometryChange();
}
}
}
@ -342,7 +340,6 @@ public class PanZoomController
// case this touchstart is just a tap that doesn't end up triggering
// a redraw
mTarget.setForceRedraw();
mTarget.notifyLayerClientOfGeometryChange();
// fall through
case FLING:
case BOUNCE:
@ -548,7 +545,6 @@ public class PanZoomController
viewportMetrics.setOrigin(origin);
mTarget.setViewportMetrics(viewportMetrics);
mTarget.notifyLayerClientOfGeometryChange();
}
private void fling() {
@ -716,7 +712,6 @@ public class PanZoomController
float t = ZOOM_ANIMATION_FRAMES[mBounceFrame];
ViewportMetrics newMetrics = mBounceStartMetrics.interpolate(mBounceEndMetrics, t);
mTarget.setViewportMetrics(newMetrics);
mTarget.notifyLayerClientOfGeometryChange();
mBounceFrame++;
}
}
@ -725,7 +720,6 @@ public class PanZoomController
private void finishBounce() {
synchronized (mTarget.getLock()) {
mTarget.setViewportMetrics(mBounceEndMetrics);
mTarget.notifyLayerClientOfGeometryChange();
mBounceFrame = -1;
}
}
@ -787,7 +781,6 @@ public class PanZoomController
// Force a viewport synchronisation
mTarget.setForceRedraw();
mTarget.notifyLayerClientOfGeometryChange();
}
/* Returns the nearest viewport metrics with no overscroll visible. */
@ -974,7 +967,6 @@ public class PanZoomController
// Force a viewport synchronisation
mTarget.setForceRedraw();
mTarget.notifyLayerClientOfGeometryChange();
}
/**
@ -985,7 +977,6 @@ public class PanZoomController
ViewportMetrics viewportMetrics = getMutableMetrics();
viewportMetrics.scaleTo(zoomFactor, focus);
mTarget.setViewportMetrics(viewportMetrics);
mTarget.notifyLayerClientOfGeometryChange();
}
public boolean getRedrawHint() {

View File

@ -17,8 +17,6 @@ public interface PanZoomTarget {
public void setAnimationTarget(ViewportMetrics viewport);
public void setViewportMetrics(ViewportMetrics viewport);
public void notifyLayerClientOfGeometryChange();
public void setForceRedraw();
public boolean post(Runnable action);