Bug 950487 - Remove unnecessary UpdateCompositionBounds function on APZC. r=Cwiiis
This commit is contained in:
@@ -1483,28 +1483,6 @@ const FrameMetrics& AsyncPanZoomController::GetFrameMetrics() {
|
||||
return mFrameMetrics;
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::UpdateCompositionBounds(const ScreenIntRect& aCompositionBounds) {
|
||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||
|
||||
ScreenIntRect oldCompositionBounds = mFrameMetrics.mCompositionBounds;
|
||||
mFrameMetrics.mCompositionBounds = aCompositionBounds;
|
||||
|
||||
// If the window had 0 dimensions before, or does now, we don't want to
|
||||
// repaint or update the zoom since we'll run into rendering issues and/or
|
||||
// divide-by-zero. This manifests itself as the screen flashing. If the page
|
||||
// has gone out of view, the buffer will be cleared elsewhere anyways.
|
||||
if (aCompositionBounds.width && aCompositionBounds.height &&
|
||||
oldCompositionBounds.width && oldCompositionBounds.height) {
|
||||
float adjustmentFactor = float(aCompositionBounds.width) / float(oldCompositionBounds.width);
|
||||
mFrameMetrics.mZoom.scale =
|
||||
clamped(mFrameMetrics.mZoom.scale * adjustmentFactor,
|
||||
mMinZoom.scale, mMaxZoom.scale);
|
||||
|
||||
// Repaint on a rotation so that our new resolution gets properly updated.
|
||||
RequestContentRepaint();
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::ZoomToRect(CSSRect aRect) {
|
||||
SetState(ANIMATING_ZOOM);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user