mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 777075 - Remove notifyLayerClientOfGeometryChange from the PanZoomTarget interface by baking it into setViewportMetrics and setForceRedraw. r=mbrubeck
This commit is contained in:
parent
7eaf38a762
commit
f24402c6c9
@ -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() {
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user