Bug 730966 - Remove time-based throttling of viewport change events; the refresh driver does this in Gecko already. r=pcwalton

This commit is contained in:
Kartikaya Gupta 2012-02-29 16:42:53 -05:00
Родитель 8a2f9c6826
Коммит 72287d98e8
1 изменённых файлов: 2 добавлений и 29 удалений

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

@ -79,9 +79,6 @@ public class GeckoLayerClient implements GeckoEventResponder,
/* The viewport that Gecko will display when drawing is finished */
private ViewportMetrics mNewGeckoViewport;
private static final long MIN_VIEWPORT_CHANGE_DELAY = 25L;
private long mLastViewportChangeTime;
private boolean mPendingViewportAdjust;
private boolean mViewportSizeChanged;
private boolean mIgnorePaintsPendingViewportSizeChange;
private boolean mFirstPaint = true;
@ -266,29 +263,6 @@ public class GeckoLayerClient implements GeckoEventResponder,
return null;
}
private void adjustViewportWithThrottling() {
if (!mLayerController.getRedrawHint())
return;
if (mPendingViewportAdjust)
return;
long timeDelta = System.currentTimeMillis() - mLastViewportChangeTime;
if (timeDelta < MIN_VIEWPORT_CHANGE_DELAY) {
mLayerController.getView().postDelayed(
new Runnable() {
public void run() {
mPendingViewportAdjust = false;
adjustViewport();
}
}, MIN_VIEWPORT_CHANGE_DELAY - timeDelta);
mPendingViewportAdjust = true;
return;
}
adjustViewport();
}
void viewportSizeChanged() {
mViewportSizeChanged = true;
mIgnorePaintsPendingViewportSizeChange = true;
@ -305,8 +279,6 @@ public class GeckoLayerClient implements GeckoEventResponder,
mViewportSizeChanged = false;
GeckoAppShell.viewSizeChanged();
}
mLastViewportChangeTime = System.currentTimeMillis();
}
/** Implementation of GeckoEventResponder/GeckoEventListener. */
@ -338,7 +310,8 @@ public class GeckoLayerClient implements GeckoEventResponder,
void geometryChanged() {
/* Let Gecko know if the screensize has changed */
sendResizeEventIfNecessary(false);
adjustViewportWithThrottling();
if (mLayerController.getRedrawHint())
adjustViewport();
}
public int getWidth() {