Bug 750417 - Remove Redraw calls from nsSprocketLayout. r=roc

This commit is contained in:
Matt Woodrow 2012-10-17 10:30:37 +13:00
Родитель 65d3ca6956
Коммит c91003698d
2 изменённых файлов: 4 добавлений и 19 удалений

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

@ -251,7 +251,6 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
}
// With the sizes computed, now it's time to lay out our children.
bool needsRedraw = false;
bool finished;
nscoord passes = 0;
@ -472,15 +471,8 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// set it again
child->SetBounds(aState, childRect);
// Since the child changed size, we know a redraw is probably going to be required.
needsRedraw = true;
}
// if something moved then we might need to redraw
if (oldRect.x != childRect.x || oldRect.y != childRect.y)
needsRedraw = true;
// If we already determined that layout was required or if our size has changed, then
// we make sure to call layout on the child, since its children may need to be shifted
// around as a result of the size change.
@ -632,13 +624,9 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// Perform out-of-axis alignment for non-stretch alignments
if (!(frameState & NS_STATE_AUTO_STRETCH)) {
AlignChildren(aBox, aState, &needsRedraw);
AlignChildren(aBox, aState);
}
// Now do our redraw.
if (needsRedraw)
aBox->Redraw(aState);
// That's it! If you made it this far without having a nervous breakdown,
// congratulations! Go get yourself a beer.
return NS_OK;
@ -919,8 +907,7 @@ nsSprocketLayout::ComputeChildsNextPosition(nsIFrame* aBox,
void
nsSprocketLayout::AlignChildren(nsIFrame* aBox,
nsBoxLayoutState& aState,
bool* aNeedsRedraw)
nsBoxLayoutState& aState)
{
nsFrameState frameState = 0;
GetFrameState(aBox, frameState);
@ -1005,7 +992,6 @@ nsSprocketLayout::AlignChildren(nsIFrame* aBox,
}
if (childRect.TopLeft() != child->GetPosition()) {
*aNeedsRedraw = true;
child->SetBounds(aState, childRect);
}

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

@ -110,8 +110,7 @@ protected:
bool& aFinished);
void AlignChildren(nsIFrame* aBox,
nsBoxLayoutState& aState,
bool* aNeedsRedraw);
nsBoxLayoutState& aState);
virtual void ComputeChildSizes(nsIFrame* aBox,
nsBoxLayoutState& aState,