Don't do a O(N) walk over all lines when painting floats, since we already have

a nice sorted list of floats about.  Bug 52005, r+sr=dbaron, a=brendan
This commit is contained in:
bzbarsky%mit.edu 2004-04-09 21:08:09 +00:00
Родитель d246d9dee9
Коммит e241461844
2 изменённых файлов: 18 добавлений и 34 удалений

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

@ -5302,23 +5302,15 @@ nsBlockFrame::PaintFloats(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
for (line_iterator line = begin_lines(), line_end = end_lines();
line != line_end;
++line) {
if (!line->HasFloats()) {
continue;
}
nsFloatCache* fc = line->GetFirstFloat();
while (fc) {
nsIFrame* floatFrame = fc->mPlaceholder->GetOutOfFlowFrame();
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_BACKGROUND);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FLOATS);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FOREGROUND);
fc = fc->Next();
}
for (nsIFrame* floatFrame = mFloats.FirstChild();
floatFrame;
floatFrame = floatFrame->GetNextSibling()) {
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_BACKGROUND);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FLOATS);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FOREGROUND);
}
}

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

@ -5302,23 +5302,15 @@ nsBlockFrame::PaintFloats(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect)
{
for (line_iterator line = begin_lines(), line_end = end_lines();
line != line_end;
++line) {
if (!line->HasFloats()) {
continue;
}
nsFloatCache* fc = line->GetFirstFloat();
while (fc) {
nsIFrame* floatFrame = fc->mPlaceholder->GetOutOfFlowFrame();
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_BACKGROUND);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FLOATS);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FOREGROUND);
fc = fc->Next();
}
for (nsIFrame* floatFrame = mFloats.FirstChild();
floatFrame;
floatFrame = floatFrame->GetNextSibling()) {
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_BACKGROUND);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FLOATS);
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
floatFrame, NS_FRAME_PAINT_LAYER_FOREGROUND);
}
}