Updated to use new image loading apis

This commit is contained in:
kipp%netscape.com 1999-04-13 21:52:19 +00:00
parent a0b4329e22
commit a75693e1fa
2 changed files with 12 additions and 18 deletions

View File

@ -162,6 +162,7 @@ nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style,
theColor = colors[0];
break;
case NS_SIDE_LEFT:
default:
theColor = colors[0];
break;
}
@ -1685,16 +1686,15 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
nsIFrameImageLoader* loader = nsnull;
PRBool transparentBG = NS_STYLE_BG_COLOR_TRANSPARENT ==
(aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT);
nsSize loadSize(0, 0);
nsresult rv = aPresContext.StartLoadImage(aColor.mBackgroundImage,
transparentBG
? nsnull
: &aColor.mBackgroundColor,
aForFrame, loadSize,
nsnull,
PR_FALSE, PR_FALSE, &loader);
aForFrame, nsnull, nsnull,
&loader);
if ((NS_OK != rv) || (nsnull == loader) ||
(loader->GetImage(image), (nsnull == image))) {
(loader->GetImage(&image), (nsnull == image))) {
NS_IF_RELEASE(loader);
// Redraw will happen later
if (!transparentBG) {
@ -1714,11 +1714,8 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
}
#endif
// Convert image dimensions into nscoord's
float p2t;
aPresContext.GetScaledPixelsToTwips(&p2t);
nscoord tileWidth = NSIntPixelsToTwips(imageSize.width, p2t);
nscoord tileHeight = NSIntPixelsToTwips(imageSize.height, p2t);
nscoord tileWidth = imageSize.width;
nscoord tileHeight = imageSize.height;
if ((tileWidth == 0) || (tileHeight == 0)) {
return;
}

View File

@ -162,6 +162,7 @@ nscolor nsCSSRendering::MakeBevelColor(PRIntn whichSide, PRUint8 style,
theColor = colors[0];
break;
case NS_SIDE_LEFT:
default:
theColor = colors[0];
break;
}
@ -1685,16 +1686,15 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
nsIFrameImageLoader* loader = nsnull;
PRBool transparentBG = NS_STYLE_BG_COLOR_TRANSPARENT ==
(aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT);
nsSize loadSize(0, 0);
nsresult rv = aPresContext.StartLoadImage(aColor.mBackgroundImage,
transparentBG
? nsnull
: &aColor.mBackgroundColor,
aForFrame, loadSize,
nsnull,
PR_FALSE, PR_FALSE, &loader);
aForFrame, nsnull, nsnull,
&loader);
if ((NS_OK != rv) || (nsnull == loader) ||
(loader->GetImage(image), (nsnull == image))) {
(loader->GetImage(&image), (nsnull == image))) {
NS_IF_RELEASE(loader);
// Redraw will happen later
if (!transparentBG) {
@ -1714,11 +1714,8 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext,
}
#endif
// Convert image dimensions into nscoord's
float p2t;
aPresContext.GetScaledPixelsToTwips(&p2t);
nscoord tileWidth = NSIntPixelsToTwips(imageSize.width, p2t);
nscoord tileHeight = NSIntPixelsToTwips(imageSize.height, p2t);
nscoord tileWidth = imageSize.width;
nscoord tileHeight = imageSize.height;
if ((tileWidth == 0) || (tileHeight == 0)) {
return;
}