Bug 1018980 - Kill some dead code in Fennec from the pre-OMTC days. r=snorp

This commit is contained in:
Kartikaya Gupta
2014-06-02 11:13:09 -04:00
parent b22d3861c5
commit c756478ac7
7 changed files with 2 additions and 144 deletions

View File

@@ -127,9 +127,7 @@ nsAppShell::nsAppShell()
: mQueueLock("nsAppShell.mQueueLock"),
mCondLock("nsAppShell.mCondLock"),
mQueueCond(mCondLock, "nsAppShell.mQueueCond"),
mQueuedDrawEvent(nullptr),
mQueuedViewportEvent(nullptr),
mAllowCoalescingNextDraw(false)
mQueuedViewportEvent(nullptr)
{
gAppShell = this;
@@ -673,9 +671,7 @@ nsAppShell::PopNextEvent()
if (mEventQueue.Length()) {
ae = mEventQueue[0];
mEventQueue.RemoveElementAt(0);
if (mQueuedDrawEvent == ae) {
mQueuedDrawEvent = nullptr;
} else if (mQueuedViewportEvent == ae) {
if (mQueuedViewportEvent == ae) {
mQueuedViewportEvent = nullptr;
}
}
@@ -724,50 +720,6 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
}
break;
case AndroidGeckoEvent::DRAW:
if (mQueuedDrawEvent) {
#if defined(DEBUG) || defined(FORCE_ALOG)
// coalesce this new draw event with the one already in the queue
const nsIntRect& oldRect = mQueuedDrawEvent->Rect();
const nsIntRect& newRect = ae->Rect();
nsIntRect combinedRect = oldRect.Union(newRect);
// XXX We may want to consider using regions instead of rectangles.
// Print an error if we're upload a lot more than we would
// if we handled this as two separate events.
int combinedArea = (oldRect.width * oldRect.height) +
(newRect.width * newRect.height);
int boundsArea = combinedRect.width * combinedRect.height;
if (boundsArea > combinedArea * 8)
ALOG("nsAppShell: Area of bounds greatly exceeds combined area: %d > %d",
boundsArea, combinedArea);
#endif
// coalesce into the new draw event rather than the queued one because
// it is not always safe to move draws earlier in the queue; there may
// be events between the two draws that affect scroll position or something.
ae->UnionRect(mQueuedDrawEvent->Rect());
EVLOG("nsAppShell: Coalescing previous DRAW event at %p into new DRAW event %p", mQueuedDrawEvent, ae);
mEventQueue.RemoveElement(mQueuedDrawEvent);
delete mQueuedDrawEvent;
}
if (!mAllowCoalescingNextDraw) {
// if we're not allowing coalescing of this draw event, then
// don't set mQueuedDrawEvent to point to this; that way the
// next draw event that comes in won't kill this one.
mAllowCoalescingNextDraw = true;
mQueuedDrawEvent = nullptr;
} else {
mQueuedDrawEvent = ae;
}
allowCoalescingNextViewport = true;
mEventQueue.AppendElement(ae);
break;
case AndroidGeckoEvent::VIEWPORT:
if (mQueuedViewportEvent) {
// drop the previous viewport event now that we have a new one
@@ -776,9 +728,6 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
delete mQueuedViewportEvent;
}
mQueuedViewportEvent = ae;
// temporarily turn off draw-coalescing, so that we process a draw
// event as soon as possible after a viewport change
mAllowCoalescingNextDraw = false;
allowCoalescingNextViewport = true;
mEventQueue.AppendElement(ae);