зеркало из 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,
|
nsIRenderingContext& aRenderingContext,
|
||||||
const nsRect& aDirtyRect)
|
const nsRect& aDirtyRect)
|
||||||
{
|
{
|
||||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
for (nsIFrame* floatFrame = mFloats.FirstChild();
|
||||||
line != line_end;
|
floatFrame;
|
||||||
++line) {
|
floatFrame = floatFrame->GetNextSibling()) {
|
||||||
if (!line->HasFloats()) {
|
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
|
||||||
continue;
|
floatFrame, NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||||
}
|
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
|
||||||
nsFloatCache* fc = line->GetFirstFloat();
|
floatFrame, NS_FRAME_PAINT_LAYER_FLOATS);
|
||||||
while (fc) {
|
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
|
||||||
nsIFrame* floatFrame = fc->mPlaceholder->GetOutOfFlowFrame();
|
floatFrame, NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5302,23 +5302,15 @@ nsBlockFrame::PaintFloats(nsIPresContext* aPresContext,
|
||||||
nsIRenderingContext& aRenderingContext,
|
nsIRenderingContext& aRenderingContext,
|
||||||
const nsRect& aDirtyRect)
|
const nsRect& aDirtyRect)
|
||||||
{
|
{
|
||||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
for (nsIFrame* floatFrame = mFloats.FirstChild();
|
||||||
line != line_end;
|
floatFrame;
|
||||||
++line) {
|
floatFrame = floatFrame->GetNextSibling()) {
|
||||||
if (!line->HasFloats()) {
|
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
|
||||||
continue;
|
floatFrame, NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||||
}
|
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
|
||||||
nsFloatCache* fc = line->GetFirstFloat();
|
floatFrame, NS_FRAME_PAINT_LAYER_FLOATS);
|
||||||
while (fc) {
|
PaintChild(aPresContext, aRenderingContext, aDirtyRect,
|
||||||
nsIFrame* floatFrame = fc->mPlaceholder->GetOutOfFlowFrame();
|
floatFrame, NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче