Back out 35bf7e6dbf90 (bug 882120) for reftest and crashtest failures

This commit is contained in:
Phil Ringnalda 2013-06-18 09:00:56 -07:00
Родитель ac238c8b06
Коммит 7d168d7315
2 изменённых файлов: 3 добавлений и 15 удалений

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

@ -560,12 +560,10 @@ public class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
Tab tab = Tabs.getInstance().getSelectedTab();
RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
RectF pageRect = RectUtils.scaleAndRound(cssPageRect, zoom);
final ImmutableViewportMetrics newMetrics = currentMetrics
.setViewportOrigin(offsetX, offsetY)
.setZoomFactor(zoom)
.setPageRect(pageRect, cssPageRect)
.setPageRect(RectUtils.scale(cssPageRect, zoom), cssPageRect)
.setIsRTL(tab.getIsRTL());
// Since we have switched to displaying a different document, we need to update any
// viewport-related state we have lying around. This includes mGeckoViewport and
@ -612,10 +610,9 @@ public class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
*/
public void setPageRect(float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
synchronized (getLock()) {
float ourZoom = getViewportMetrics().zoomFactor;
RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
RectF pageRect = RectUtils.scaleAndRound(cssPageRect, ourZoom);
setPageRect(pageRect, cssPageRect);
float ourZoom = getViewportMetrics().zoomFactor;
setPageRect(RectUtils.scale(cssPageRect, ourZoom), cssPageRect);
// Here the page size of the document has changed, but the document being displayed
// is still the same. Therefore, we don't need to send anything to browser.js; any
// changes we need to make to the display port will get sent the next time we call

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

@ -74,15 +74,6 @@ public final class RectUtils {
y + (rect.height() * scale));
}
public static RectF scaleAndRound(RectF rect, float scale) {
float left = rect.left * scale;
float top = rect.top * scale;
return new RectF(Math.round(left),
Math.round(top),
Math.round(left + (rect.width() * scale)),
Math.round(top + (rect.height() * scale)));
}
/** Returns the nearest integer rect of the given rect. */
public static Rect round(RectF rect) {
Rect r = new Rect();