Kaydet (Commit) 40e919d2 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

android: remove notifyLayerClientOfGeometryChange (Fennec import)

Change-Id: Ibc1f4d11dcfdf177cd45fcf689b518d975b13709
üst 0151bf3f
...@@ -87,6 +87,7 @@ public class LayerController implements PanZoomTarget { ...@@ -87,6 +87,7 @@ public class LayerController implements PanZoomTarget {
public void setForceRedraw() { public void setForceRedraw() {
mForceRedraw = true; mForceRedraw = true;
notifyLayerClientOfGeometryChange();
} }
public Layer getRoot() { return mRootLayer; } public Layer getRoot() { return mRootLayer; }
...@@ -159,14 +160,13 @@ public class LayerController implements PanZoomTarget { ...@@ -159,14 +160,13 @@ public class LayerController implements PanZoomTarget {
} }
/** /**
* Sets the entire viewport metrics at once. This function does not notify the layer client or * Sets the entire viewport metrics at once.
* the pan/zoom controller, so you will need to call notifyLayerClientOfGeometryChange() or * You must hold the monitor while calling this.
* notifyPanZoomControllerOfGeometryChange() after calling this. You must hold the monitor
* while calling this.
*/ */
public void setViewportMetrics(ViewportMetrics viewport) { public void setViewportMetrics(ViewportMetrics viewport) {
mViewportMetrics = new ImmutableViewportMetrics(viewport); mViewportMetrics = new ImmutableViewportMetrics(viewport);
mView.requestRender(); mView.requestRender();
notifyLayerClientOfGeometryChange();
} }
public void setAnimationTarget(ViewportMetrics viewport) { public void setAnimationTarget(ViewportMetrics viewport) {
...@@ -183,11 +183,7 @@ public class LayerController implements PanZoomTarget { ...@@ -183,11 +183,7 @@ public class LayerController implements PanZoomTarget {
public boolean post(Runnable action) { return mView.post(action); } public boolean post(Runnable action) { return mView.post(action); }
/** private void notifyLayerClientOfGeometryChange() {
* The view as well as the controller itself use this method to notify the layer client that
* the geometry changed.
*/
public void notifyLayerClientOfGeometryChange() {
if (mLayerClient != null) if (mLayerClient != null)
mLayerClient.geometryChanged(); mLayerClient.geometryChanged();
} }
......
...@@ -195,7 +195,6 @@ public class PanZoomController ...@@ -195,7 +195,6 @@ public class PanZoomController
// transitions. // transitions.
synchronized (mTarget.getLock()) { synchronized (mTarget.getLock()) {
mTarget.setViewportMetrics(getValidViewportMetrics()); mTarget.setViewportMetrics(getValidViewportMetrics());
mTarget.notifyLayerClientOfGeometryChange();
} }
break; break;
} }
...@@ -233,7 +232,6 @@ public class PanZoomController ...@@ -233,7 +232,6 @@ public class PanZoomController
// page size changed such that we are now in overscroll. snap to the // page size changed such that we are now in overscroll. snap to the
// the nearest valid viewport // the nearest valid viewport
mTarget.setViewportMetrics(validated); mTarget.setViewportMetrics(validated);
mTarget.notifyLayerClientOfGeometryChange();
} }
} }
} }
...@@ -254,7 +252,6 @@ public class PanZoomController ...@@ -254,7 +252,6 @@ public class PanZoomController
// case this touchstart is just a tap that doesn't end up triggering // case this touchstart is just a tap that doesn't end up triggering
// a redraw // a redraw
mTarget.setForceRedraw(); mTarget.setForceRedraw();
mTarget.notifyLayerClientOfGeometryChange();
// fall through // fall through
case FLING: case FLING:
case BOUNCE: case BOUNCE:
...@@ -460,7 +457,6 @@ public class PanZoomController ...@@ -460,7 +457,6 @@ public class PanZoomController
viewportMetrics.setOrigin(origin); viewportMetrics.setOrigin(origin);
mTarget.setViewportMetrics(viewportMetrics); mTarget.setViewportMetrics(viewportMetrics);
mTarget.notifyLayerClientOfGeometryChange();
} }
private void fling() { private void fling() {
...@@ -628,7 +624,6 @@ public class PanZoomController ...@@ -628,7 +624,6 @@ public class PanZoomController
float t = ZOOM_ANIMATION_FRAMES[mBounceFrame]; float t = ZOOM_ANIMATION_FRAMES[mBounceFrame];
ViewportMetrics newMetrics = mBounceStartMetrics.interpolate(mBounceEndMetrics, t); ViewportMetrics newMetrics = mBounceStartMetrics.interpolate(mBounceEndMetrics, t);
mTarget.setViewportMetrics(newMetrics); mTarget.setViewportMetrics(newMetrics);
mTarget.notifyLayerClientOfGeometryChange();
mBounceFrame++; mBounceFrame++;
} }
} }
...@@ -637,7 +632,6 @@ public class PanZoomController ...@@ -637,7 +632,6 @@ public class PanZoomController
private void finishBounce() { private void finishBounce() {
synchronized (mTarget.getLock()) { synchronized (mTarget.getLock()) {
mTarget.setViewportMetrics(mBounceEndMetrics); mTarget.setViewportMetrics(mBounceEndMetrics);
mTarget.notifyLayerClientOfGeometryChange();
mBounceFrame = -1; mBounceFrame = -1;
} }
} }
...@@ -699,7 +693,6 @@ public class PanZoomController ...@@ -699,7 +693,6 @@ public class PanZoomController
// Force a viewport synchronisation // Force a viewport synchronisation
mTarget.setForceRedraw(); mTarget.setForceRedraw();
mTarget.notifyLayerClientOfGeometryChange();
} }
/* Returns the nearest viewport metrics with no overscroll visible. */ /* Returns the nearest viewport metrics with no overscroll visible. */
...@@ -883,7 +876,6 @@ public class PanZoomController ...@@ -883,7 +876,6 @@ public class PanZoomController
// Force a viewport synchronisation // Force a viewport synchronisation
mTarget.setForceRedraw(); mTarget.setForceRedraw();
mTarget.notifyLayerClientOfGeometryChange();
} }
/** /**
...@@ -894,7 +886,6 @@ public class PanZoomController ...@@ -894,7 +886,6 @@ public class PanZoomController
ViewportMetrics viewportMetrics = getMutableMetrics(); ViewportMetrics viewportMetrics = getMutableMetrics();
viewportMetrics.scaleTo(zoomFactor, focus); viewportMetrics.scaleTo(zoomFactor, focus);
mTarget.setViewportMetrics(viewportMetrics); mTarget.setViewportMetrics(viewportMetrics);
mTarget.notifyLayerClientOfGeometryChange();
} }
public boolean getRedrawHint() { public boolean getRedrawHint() {
......
...@@ -17,8 +17,6 @@ public interface PanZoomTarget { ...@@ -17,8 +17,6 @@ public interface PanZoomTarget {
public void setAnimationTarget(ViewportMetrics viewport); public void setAnimationTarget(ViewportMetrics viewport);
public void setViewportMetrics(ViewportMetrics viewport); public void setViewportMetrics(ViewportMetrics viewport);
public void notifyLayerClientOfGeometryChange();
public void setForceRedraw(); public void setForceRedraw();
public boolean post(Runnable action); public boolean post(Runnable action);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment