Bug 973619 - Pick up the zoom from layout when the viewport dimensions change. r=botond

This commit is contained in:
Kartikaya Gupta 2015-01-09 10:21:50 -05:00
parent 03ca5722e2
commit 24c0c86920

View File

@ -2696,6 +2696,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
mPaintThrottler.TaskComplete(GetFrameTime());
bool needContentRepaint = false;
bool viewportUpdated = false;
if (FuzzyEqualsAdditive(aLayerMetrics.mCompositionBounds.width, mFrameMetrics.mCompositionBounds.width) &&
FuzzyEqualsAdditive(aLayerMetrics.mCompositionBounds.height, mFrameMetrics.mCompositionBounds.height)) {
// Remote content has sync'd up to the composition geometry
@ -2703,6 +2704,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
if (mFrameMetrics.GetViewport().width != aLayerMetrics.GetViewport().width ||
mFrameMetrics.GetViewport().height != aLayerMetrics.GetViewport().height) {
needContentRepaint = true;
viewportUpdated = true;
}
mFrameMetrics.SetViewport(aLayerMetrics.GetViewport());
}
@ -2743,7 +2745,8 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
// determined by Gecko and our copy in mFrameMetrics may be stale.
if (FuzzyEqualsAdditive(mFrameMetrics.mCompositionBounds.width, aLayerMetrics.mCompositionBounds.width) &&
mFrameMetrics.GetDevPixelsPerCSSPixel() == aLayerMetrics.GetDevPixelsPerCSSPixel()) {
mFrameMetrics.GetDevPixelsPerCSSPixel() == aLayerMetrics.GetDevPixelsPerCSSPixel() &&
!viewportUpdated) {
// Any change to the pres shell resolution was requested by APZ and is
// already included in our zoom; however, other components of the
// cumulative resolution (a parent document's pres-shell resolution, or
@ -2757,8 +2760,9 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
/ mFrameMetrics.mPresShellResolution;
mFrameMetrics.ZoomBy(totalResolutionChange / presShellResolutionChange);
} else {
// Take the new zoom as either device scale or composition width or both
// got changed (e.g. due to orientation change).
// Take the new zoom as either device scale or composition width or
// viewport size got changed (e.g. due to orientation change, or content
// changing the meta-viewport tag).
mFrameMetrics.SetZoom(aLayerMetrics.GetZoom());
mFrameMetrics.SetDevPixelsPerCSSPixel(aLayerMetrics.GetDevPixelsPerCSSPixel());
}