Bug 968222 - Update zoom scale in APZC upon orientation change. r=botond,kats

From f60ff14c5fdd1f7fef29ea5b2d7b4c8fa5710157 Mon Sep 17 00:00:00 2001
---
 gfx/layers/ipc/AsyncPanZoomController.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
This commit is contained in:
Dmitry Rozhkov 2014-02-06 11:57:42 +02:00
Родитель 3d6b8ab2eb
Коммит 5ee0e76945
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -1656,11 +1656,17 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
// If we're not taking the aLayerMetrics wholesale we still need to pull
// in some things into our local mFrameMetrics because these things are
// determined by Gecko and our copy in mFrameMetrics may be stale.
if (mFrameMetrics.mCompositionBounds.width == aLayerMetrics.mCompositionBounds.width) {
float parentResolutionChange = aLayerMetrics.GetParentResolution().scale
/ mFrameMetrics.GetParentResolution().scale;
mFrameMetrics.mZoom.scale *= parentResolutionChange;
} else {
// Take the new zoom as composition width got changed (i.e. due to orientation change)
mFrameMetrics.mZoom.scale = aLayerMetrics.mZoom.scale;
}
mFrameMetrics.mScrollableRect = aLayerMetrics.mScrollableRect;
mFrameMetrics.mCompositionBounds = aLayerMetrics.mCompositionBounds;
float parentResolutionChange = aLayerMetrics.GetParentResolution().scale
/ mFrameMetrics.GetParentResolution().scale;
mFrameMetrics.mZoom.scale *= parentResolutionChange;
mFrameMetrics.mResolution = aLayerMetrics.mResolution;
mFrameMetrics.mCumulativeResolution = aLayerMetrics.mCumulativeResolution;
mFrameMetrics.mHasScrollgrab = aLayerMetrics.mHasScrollgrab;