Bug 787445: B2G: Rip out async paint throttling code, use compression instead r=cjones

This commit is contained in:
Doug Sherk 2012-09-29 00:02:41 -04:00
parent 68e9a49d58
commit 19cc16c9aa
3 changed files with 13 additions and 40 deletions

View File

@ -288,9 +288,9 @@ child:
LoadURL(nsCString uri);
UpdateDimensions(nsRect rect, nsIntSize size);
UpdateDimensions(nsRect rect, nsIntSize size) compress;
UpdateFrame(FrameMetrics frame);
UpdateFrame(FrameMetrics frame) compress;
/**
* Requests handling of a double tap. |point| is in CSS pixels, relative to

View File

@ -92,7 +92,7 @@ AsyncPanZoomController::AsyncPanZoomController(GeckoContentController* aGeckoCon
mLastSampleTime(TimeStamp::Now()),
mState(NOTHING),
mDPI(72),
mContentPainterStatus(CONTENT_IDLE),
mWaitingForContentToPaint(false),
mDisableNextTouchBatch(false),
mHandlingTouchQueue(false)
{
@ -819,13 +819,12 @@ void AsyncPanZoomController::RequestContentRepaint() {
return;
}
if (mContentPainterStatus == CONTENT_IDLE) {
mContentPainterStatus = CONTENT_PAINTING;
mLastPaintRequestMetrics = mFrameMetrics;
mGeckoContentController->RequestContentRepaint(mFrameMetrics);
} else {
mContentPainterStatus = CONTENT_PAINTING_AND_PAINT_PENDING;
}
// This message is compressed, so fire whether or not we already have a paint
// queued up. We need to know whether or not a paint was requested anyways,
// ofr the purposes of content calling window.scrollTo().
mGeckoContentController->RequestContentRepaint(mFrameMetrics);
mLastPaintRequestMetrics = mFrameMetrics;
mWaitingForContentToPaint = true;
}
bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSampleTime,
@ -932,14 +931,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aViewportFr
mLastContentPaintMetrics = aViewportFrame;
if (mContentPainterStatus != CONTENT_IDLE) {
if (mContentPainterStatus == CONTENT_PAINTING_AND_PAINT_PENDING) {
mContentPainterStatus = CONTENT_IDLE;
RequestContentRepaint();
} else {
mContentPainterStatus = CONTENT_IDLE;
}
} else {
if (!mWaitingForContentToPaint) {
// No paint was requested, but we got one anyways. One possible cause of this
// is that content could have fired a scrollTo(). In this case, we should take
// the new scroll offset. Document/viewport changes are handled elsewhere.
@ -959,9 +951,9 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aViewportFr
}
}
if (aIsFirstPaint || mFrameMetrics.IsDefault()) {
mContentPainterStatus = CONTENT_IDLE;
mWaitingForContentToPaint = false;
if (aIsFirstPaint || mFrameMetrics.IsDefault()) {
mX.CancelTouch();
mY.CancelTouch();

View File

@ -424,25 +424,6 @@ private:
prevented the default actions yet. we still need to abort animations. */
};
enum ContentPainterStatus {
// A paint may be happening, but it is not due to any action taken by this
// thread. For example, content could be invalidating itself, but
// AsyncPanZoomController has nothing to do with that.
CONTENT_IDLE,
// Set every time we dispatch a request for a repaint. When a
// ShadowLayersUpdate arrives and the metrics of this frame have changed, we
// toggle this off and assume that the paint has completed.
CONTENT_PAINTING,
// Set when we have a new displayport in the pipeline that we want to paint.
// When a ShadowLayersUpdate comes in, we dispatch a new repaint using
// mFrameMetrics.mDisplayPort (the most recent request) if this is toggled.
// This is distinct from CONTENT_PAINTING in that it signals that a repaint
// is happening, whereas this signals that we want to repaint as soon as the
// previous paint finishes. When the request is eventually made, it will use
// the most up-to-date metrics.
CONTENT_PAINTING_AND_PAINT_PENDING
};
/**
* Helper to set the current state. Holds the monitor before actually setting
* it. If the monitor is already held by the current thread, it is safe to
@ -521,7 +502,7 @@ private:
// may be triggered by other things (like content doing things), in which case
// this status will not be updated. It is only changed when this class
// requests a repaint.
ContentPainterStatus mContentPainterStatus;
bool mWaitingForContentToPaint;
// Flag used to determine whether or not we should disable handling of the
// next batch of touch events. This is used for sync scrolling of subframes.