mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 701594 - Part 4: Make LayerController.setViewportMetrics() not automatically assume it was called by the layer client. r=kats
This commit is contained in:
parent
4e750df483
commit
bd59295e9c
@ -125,8 +125,11 @@ public class GeckoSoftwareLayerClient extends LayerClient implements GeckoEventL
|
||||
super.setLayerController(layerController);
|
||||
|
||||
layerController.setRoot(mTileLayer);
|
||||
if (mGeckoViewport != null)
|
||||
if (mGeckoViewport != null) {
|
||||
layerController.setViewportMetrics(mGeckoViewport);
|
||||
layerController.notifyPanZoomControllerOfGeometryChange(false);
|
||||
}
|
||||
|
||||
geometryChanged();
|
||||
GeckoAppShell.registerGeckoEventListener("Viewport:Update", this);
|
||||
GeckoAppShell.registerGeckoEventListener("Viewport:UpdateLater", this);
|
||||
@ -166,6 +169,7 @@ public class GeckoSoftwareLayerClient extends LayerClient implements GeckoEventL
|
||||
controller.setPageSize(mGeckoViewport.getPageSize());
|
||||
} else {
|
||||
controller.setViewportMetrics(mGeckoViewport);
|
||||
controller.notifyPanZoomControllerOfGeometryChange(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -212,12 +212,13 @@ public class LayerController {
|
||||
mView.requestRender();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public void setViewportMetrics(ViewportMetrics viewport) {
|
||||
mViewportMetrics = new ViewportMetrics(viewport);
|
||||
|
||||
// We assume this was called by the LayerClient (as it includes page
|
||||
// size), so no need to notify it of this change.
|
||||
mPanZoomController.geometryChanged(true);
|
||||
GeckoApp.mAppContext.repositionPluginViews(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
@ -256,6 +257,12 @@ public class LayerController {
|
||||
mLayerClient.geometryChanged();
|
||||
}
|
||||
|
||||
/** Informs the pan/zoom controller that the viewport metrics changed. */
|
||||
public void notifyPanZoomControllerOfGeometryChange(boolean abortFling) {
|
||||
if (mPanZoomController != null)
|
||||
mPanZoomController.geometryChanged(abortFling);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this controller is fine with performing a redraw operation or false if it
|
||||
* would prefer that the action didn't take place.
|
||||
|
@ -153,6 +153,7 @@ public class PlaceholderLayerClient extends LayerClient {
|
||||
if (mViewportUnknown)
|
||||
mViewport.setViewport(layerController.getViewport());
|
||||
layerController.setViewportMetrics(mViewport);
|
||||
layerController.notifyPanZoomControllerOfGeometryChange(false);
|
||||
|
||||
BufferedCairoImage image = new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat);
|
||||
SingleTileLayer tileLayer = new SingleTileLayer(image);
|
||||
|
Loading…
Reference in New Issue
Block a user