Bug 787322 - Don't send viewport updates back to gecko on page-size updates, since Gecko already knows about it. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2012-09-04 09:52:02 -04:00
Родитель cb37d2aa26
Коммит 5a1ac360be
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -344,7 +344,7 @@ public class GeckoLayerClient
mGeckoViewport = newMetrics; mGeckoViewport = newMetrics;
} }
}); });
setViewportMetrics(newMetrics); setViewportMetrics(newMetrics, type == ViewportMessageType.UPDATE);
mDisplayPort = DisplayPortCalculator.calculate(getViewportMetrics(), null); mDisplayPort = DisplayPortCalculator.calculate(getViewportMetrics(), null);
} }
mReturnDisplayPort = mDisplayPort; mReturnDisplayPort = mDisplayPort;
@ -623,9 +623,13 @@ public class GeckoLayerClient
* You must hold the monitor while calling this. * You must hold the monitor while calling this.
*/ */
public void setViewportMetrics(ViewportMetrics viewport) { public void setViewportMetrics(ViewportMetrics viewport) {
setViewportMetrics(viewport, true);
}
private void setViewportMetrics(ViewportMetrics viewport, boolean notifyGecko) {
mViewportMetrics = new ImmutableViewportMetrics(viewport); mViewportMetrics = new ImmutableViewportMetrics(viewport);
mView.requestRender(); mView.requestRender();
if (mGeckoIsReady) { if (notifyGecko && mGeckoIsReady) {
geometryChanged(); geometryChanged();
} }
} }