Changed PaintBorder() to use the (x,y) that's passed in

This commit is contained in:
troy%netscape.com 1998-07-22 05:02:07 +00:00
Родитель eaae2365a1
Коммит 048270ffb0
15 изменённых файлов: 54 добавлений и 43 удалений

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

@ -857,7 +857,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
// Redraw will happen later
if (!transparentBG) {
aRenderingContext.SetColor(aColor.mBackgroundColor);
aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height);
aRenderingContext.FillRect(aBounds);
}
return;
}
@ -869,7 +869,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
if (image->NeedsBlend()) {
if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) {
aRenderingContext.SetColor(aColor.mBackgroundColor);
aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height);
aRenderingContext.FillRect(aBounds);
}
}
#endif
@ -902,8 +902,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
}
// Tile the background
nscoord xpos = 0, ypos = 0;
nscoord xpos0 = 0;
nscoord xpos = aBounds.x, ypos = aBounds.y;
#if XXX
// XXX support offset positioning
PRIntn xPos = aColor.mBackgroundXPosition;
@ -913,7 +912,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
aRenderingContext.SetClipRect(aDirtyRect, nsClipCombine_kIntersect);
PRIntn x, y;
for (y = 0; y <= ycount; ++y, ypos += tileHeight) {
for (x = 0, xpos = xpos0; x <= xcount; ++x, xpos += tileWidth) {
for (x = 0; x <= xcount; ++x, xpos += tileWidth) {
aRenderingContext.DrawImage(image, xpos, ypos);
}
}
@ -921,10 +920,10 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
} else {
if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) {
// XXX This step can be avoided if we have an image and it doesn't
// have any transparent pixels and the image is tiled in both
// have any transparent pixels, and the image is tiled in both
// the x and the y
aRenderingContext.SetColor(aColor.mBackgroundColor);
aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height);
aRenderingContext.FillRect(aBounds);
}
}
}

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

@ -43,6 +43,9 @@ public:
/**
* Render the background for an element using css rendering rules
* for backgrounds.
*
* Both aDirtyRect and aBounds are in the local coordinate space
* of aForFrame
*/
static void PaintBackground(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

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

@ -3900,11 +3900,12 @@ nsCSSBlockFrame::Paint(nsIPresContext& aPresContext,
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
const nsStyleSpacing* spacing =
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *color);
aDirtyRect, rect, *color);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*spacing, skipSides);
aDirtyRect, rect, *spacing, skipSides);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);

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

@ -66,11 +66,12 @@ NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
const nsStyleSpacing* spacing =
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *color);
aDirtyRect, rect, *color);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*spacing, skipSides);
aDirtyRect, rect, *spacing, skipSides);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);

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

@ -42,11 +42,12 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
const nsStyleSpacing* mySpacing =
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *myColor);
aDirtyRect, rect, *myColor);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*mySpacing, 0);
aDirtyRect, rect, *mySpacing, 0);
}
return NS_OK;
}

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

@ -66,11 +66,12 @@ NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
const nsStyleSpacing* spacing =
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *color);
aDirtyRect, rect, *color);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*spacing, skipSides);
aDirtyRect, rect, *spacing, skipSides);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);

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

@ -42,11 +42,12 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
const nsStyleSpacing* mySpacing =
(const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *myColor);
aDirtyRect, rect, *myColor);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*mySpacing, 0);
aDirtyRect, rect, *mySpacing, 0);
}
return NS_OK;
}

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

@ -857,7 +857,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
// Redraw will happen later
if (!transparentBG) {
aRenderingContext.SetColor(aColor.mBackgroundColor);
aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height);
aRenderingContext.FillRect(aBounds);
}
return;
}
@ -869,7 +869,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
if (image->NeedsBlend()) {
if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) {
aRenderingContext.SetColor(aColor.mBackgroundColor);
aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height);
aRenderingContext.FillRect(aBounds);
}
}
#endif
@ -902,8 +902,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
}
// Tile the background
nscoord xpos = 0, ypos = 0;
nscoord xpos0 = 0;
nscoord xpos = aBounds.x, ypos = aBounds.y;
#if XXX
// XXX support offset positioning
PRIntn xPos = aColor.mBackgroundXPosition;
@ -913,7 +912,7 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
aRenderingContext.SetClipRect(aDirtyRect, nsClipCombine_kIntersect);
PRIntn x, y;
for (y = 0; y <= ycount; ++y, ypos += tileHeight) {
for (x = 0, xpos = xpos0; x <= xcount; ++x, xpos += tileWidth) {
for (x = 0; x <= xcount; ++x, xpos += tileWidth) {
aRenderingContext.DrawImage(image, xpos, ypos);
}
}
@ -921,10 +920,10 @@ void nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
} else {
if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) {
// XXX This step can be avoided if we have an image and it doesn't
// have any transparent pixels and the image is tiled in both
// have any transparent pixels, and the image is tiled in both
// the x and the y
aRenderingContext.SetColor(aColor.mBackgroundColor);
aRenderingContext.FillRect(0, 0, aBounds.width, aBounds.height);
aRenderingContext.FillRect(aBounds);
}
}
}

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

@ -43,6 +43,9 @@ public:
/**
* Render the background for an element using css rendering rules
* for backgrounds.
*
* Both aDirtyRect and aBounds are in the local coordinate space
* of aForFrame
*/
static void PaintBackground(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,

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

@ -87,12 +87,12 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext,
NS_ASSERTION(nsnull!=myColor, "bad style color");
NS_ASSERTION(nsnull!=mySpacing, "bad style spacing");
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *myColor);
aDirtyRect, rect, *myColor);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*mySpacing, 0);
aDirtyRect, rect, *mySpacing, 0);
}
// for debug...

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

@ -1103,11 +1103,11 @@ NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext,
const nsStyleColor* color =
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *color);
aDirtyRect, rect, *color);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*spacing, 0);
aDirtyRect, rect, *spacing, 0);
}
// for debug...

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

@ -155,8 +155,9 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext& aPresContext,
const nsStyleColor* myColor =
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
if (nsnull != myColor) {
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *myColor);
aDirtyRect, rect, *myColor);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);

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

@ -87,12 +87,12 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext,
NS_ASSERTION(nsnull!=myColor, "bad style color");
NS_ASSERTION(nsnull!=mySpacing, "bad style spacing");
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *myColor);
aDirtyRect, rect, *myColor);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*mySpacing, 0);
aDirtyRect, rect, *mySpacing, 0);
}
// for debug...

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

@ -1103,11 +1103,11 @@ NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext,
const nsStyleColor* color =
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *color);
aDirtyRect, rect, *color);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
aDirtyRect, nsRect(0, 0, mRect.width, mRect.height),
*spacing, 0);
aDirtyRect, rect, *spacing, 0);
}
// for debug...

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

@ -155,8 +155,9 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext& aPresContext,
const nsStyleColor* myColor =
(const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
if (nsnull != myColor) {
nsRect rect(0, 0, mRect.width, mRect.height);
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,
aDirtyRect, mRect, *myColor);
aDirtyRect, rect, *myColor);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);