Improve performance by making nsWordFrame in nsLineLayout an nsDeque instead of an nsAutoVoidArray. Bug 121967, r=timeless, sr=attinasi, a=asa

git-svn-id: svn://10.0.0.236/trunk@116883 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
smontagu%netscape.com
2002-03-19 21:57:45 +00:00
parent a5a0c6c5e4
commit 395a7140b7
4 changed files with 24 additions and 20 deletions

View File

@@ -163,7 +163,8 @@ nsLineLayout::nsLineLayout(nsIPresContext* aPresContext,
mBlockReflowState(aOuterReflowState),
mBlockRS(nsnull),/* XXX temporary */
mMinLineHeight(0),
mComputeMaxElementSize(aComputeMaxElementSize)
mComputeMaxElementSize(aComputeMaxElementSize),
mWordFrames(0)
{
MOZ_COUNT_CTOR(nsLineLayout);
@@ -194,7 +195,8 @@ nsLineLayout::nsLineLayout(nsIPresContext* aPresContext,
}
nsLineLayout::nsLineLayout(nsIPresContext* aPresContext)
: mPresContext(aPresContext)
: mPresContext(aPresContext),
mWordFrames(0)
{
MOZ_COUNT_CTOR(nsLineLayout);
@@ -3329,9 +3331,9 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsRect& aCombinedArea)
void
nsLineLayout::ForgetWordFrame(nsIFrame* aFrame)
{
NS_ASSERTION((void*)aFrame == mWordFrames[0], "forget-word-frame");
if (0 != mWordFrames.Count()) {
mWordFrames.RemoveElementAt(0);
if (0 != mWordFrames.GetSize()) {
NS_ASSERTION((void*)aFrame == mWordFrames.PeekFront(), "forget-word-frame");
mWordFrames.PopFront();
}
}