Fix for bug #12751. Optimized PaintBorder() so if the dirty rect is completely

inside of the border rect, then we don't paint anything. This speed up
incremental painting


git-svn-id: svn://10.0.0.236/trunk@45026 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-08-29 03:25:56 +00:00
parent 5adc5c03b6
commit cfa7416254
2 changed files with 16 additions and 0 deletions

View File

@@ -1410,9 +1410,17 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
if (0 == border.bottom) aSkipSides |= (1 << NS_SIDE_BOTTOM);
if (0 == border.left) aSkipSides |= (1 << NS_SIDE_LEFT);
// XXX These are misnamed. Why is it that 'outside' is inside of
// 'inside' (it's produced by deflating)?
nsRect inside(aBorderArea);
nsRect outside(inside);
outside.Deflate(border);
// If the dirty rect is completely inside the border area (e.g., only the
// content is being painted), then we can skip out now
if (outside.Contains(aDirtyRect)) {
return;
}
//see if any sides are dotted or dashed
for (cnt = 0; cnt < 4; cnt++) {