зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
d246d9dee9
Коммит
e241461844
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче