зеркало из https://github.com/mozilla/pjs.git
Bug 456792 - Two more API cleanups for nsCSSRendering; patch 1; r+sr=roc
This commit is contained in:
Родитель
4c09a4f386
Коммит
5ac3a51901
|
@ -1266,7 +1266,6 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
|||
|
||||
PRBool isCanvas;
|
||||
const nsStyleBackground *color;
|
||||
const nsStylePadding* padding = aForFrame->GetStylePadding();
|
||||
const nsStyleBorder* border = aForFrame->GetStyleBorder();
|
||||
|
||||
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas)) {
|
||||
|
@ -1289,7 +1288,7 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
|||
if (!isCanvas) {
|
||||
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
|
||||
aDirtyRect, aBorderArea, *color, *border,
|
||||
*padding, aUsePrintSettings, aBGClipRect);
|
||||
aUsePrintSettings, aBGClipRect);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1319,7 +1318,7 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
|||
|
||||
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
|
||||
aDirtyRect, aBorderArea, canvasColor,
|
||||
*border, *padding, aUsePrintSettings, aBGClipRect);
|
||||
*border, aUsePrintSettings, aBGClipRect);
|
||||
}
|
||||
|
||||
inline nscoord IntDivFloor(nscoord aDividend, nscoord aDivisor)
|
||||
|
@ -1437,7 +1436,6 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
|||
const nsRect& aBorderArea,
|
||||
const nsStyleBackground& aColor,
|
||||
const nsStyleBorder& aBorder,
|
||||
const nsStylePadding& aPadding,
|
||||
PRBool aUsePrintSettings,
|
||||
nsRect* aBGClipRect)
|
||||
{
|
||||
|
@ -1502,7 +1500,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
|||
// if there is no background image or background images are turned off, try a color.
|
||||
if (!aColor.mBackgroundImage || !canDrawBackgroundImage) {
|
||||
PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea,
|
||||
aColor, aBorder, aPadding, canDrawBackgroundColor);
|
||||
aColor, aBorder, canDrawBackgroundColor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1518,7 +1516,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
|||
|
||||
if (!req || !(status & imgIRequest::STATUS_FRAME_COMPLETE) || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
|
||||
PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea,
|
||||
aColor, aBorder, aPadding, canDrawBackgroundColor);
|
||||
aColor, aBorder, canDrawBackgroundColor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1623,7 +1621,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
|||
// The background color is rendered over the 'background-clip' area
|
||||
if (needBackgroundColor) {
|
||||
PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea,
|
||||
aColor, aBorder, aPadding, canDrawBackgroundColor);
|
||||
aColor, aBorder, canDrawBackgroundColor);
|
||||
}
|
||||
|
||||
if ((tileWidth == 0) || (tileHeight == 0) || dirtyRect.IsEmpty()) {
|
||||
|
@ -2317,7 +2315,6 @@ nsCSSRendering::PaintBackgroundColor(nsPresContext* aPresContext,
|
|||
const nsRect& aBgClipArea,
|
||||
const nsStyleBackground& aColor,
|
||||
const nsStyleBorder& aBorder,
|
||||
const nsStylePadding& aPadding,
|
||||
PRBool aCanPaintNonWhite)
|
||||
{
|
||||
// If we're only allowed to paint white, then don't bail out on transparent
|
||||
|
|
|
@ -159,7 +159,6 @@ public:
|
|||
const nsRect& aBorderArea,
|
||||
const nsStyleBackground& aColor,
|
||||
const nsStyleBorder& aBorder,
|
||||
const nsStylePadding& aPadding,
|
||||
PRBool aUsePrintSettings = PR_FALSE,
|
||||
nsRect* aBGClipRect = nsnull);
|
||||
|
||||
|
@ -276,7 +275,6 @@ protected:
|
|||
const nsRect& aBgClipArea,
|
||||
const nsStyleBackground& aColor,
|
||||
const nsStyleBorder& aBorder,
|
||||
const nsStylePadding& aPadding,
|
||||
PRBool aCanPaintNonWhite);
|
||||
|
||||
static void PaintRoundedBackground(nsPresContext* aPresContext,
|
||||
|
|
|
@ -250,7 +250,6 @@ nsGfxCheckboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
void
|
||||
nsGfxCheckboxControlFrame::PaintCheckBoxFromStyle(
|
||||
nsIRenderingContext& aRenderingContext, nsPoint aPt, const nsRect& aDirtyRect) {
|
||||
const nsStylePadding* myPadding = mCheckButtonFaceStyle->GetStylePadding();
|
||||
const nsStylePosition* myPosition = mCheckButtonFaceStyle->GetStylePosition();
|
||||
const nsStyleBorder* myBorder = mCheckButtonFaceStyle->GetStyleBorder();
|
||||
const nsStyleBackground* myBackground = mCheckButtonFaceStyle->GetStyleBackground();
|
||||
|
@ -267,7 +266,7 @@ nsGfxCheckboxControlFrame::PaintCheckBoxFromStyle(
|
|||
|
||||
nsCSSRendering::PaintBackgroundWithSC(PresContext(), aRenderingContext,
|
||||
this, aDirtyRect, rect, *myBackground,
|
||||
*myBorder, *myPadding, PR_FALSE);
|
||||
*myBorder, PR_FALSE);
|
||||
nsCSSRendering::PaintBorder(PresContext(), aRenderingContext, this,
|
||||
aDirtyRect, rect, *myBorder,
|
||||
mCheckButtonFaceStyle);
|
||||
|
|
|
@ -130,7 +130,6 @@ nsGfxRadioControlFrame::PaintRadioButtonFromStyle(
|
|||
// Paint the button for the radio button using CSS background rendering code
|
||||
const nsStyleBackground* myColor = mRadioButtonFaceStyle->GetStyleBackground();
|
||||
const nsStyleColor* color = mRadioButtonFaceStyle->GetStyleColor();
|
||||
const nsStylePadding* myPadding = mRadioButtonFaceStyle->GetStylePadding();
|
||||
const nsStylePosition* myPosition = mRadioButtonFaceStyle->GetStylePosition();
|
||||
|
||||
NS_ASSERTION(myPosition->mWidth.GetUnit() == eStyleUnit_Coord &&
|
||||
|
@ -154,7 +153,7 @@ nsGfxRadioControlFrame::PaintRadioButtonFromStyle(
|
|||
nsPresContext* pc = PresContext();
|
||||
nsCSSRendering::PaintBackgroundWithSC(pc, aRenderingContext,
|
||||
this, aDirtyRect, rect,
|
||||
tmpColor, *myBorder, *myPadding, PR_FALSE);
|
||||
tmpColor, *myBorder, PR_FALSE);
|
||||
nsCSSRendering::PaintBorder(pc, aRenderingContext, this,
|
||||
aDirtyRect, rect, *myBorder, mRadioButtonFaceStyle, 0);
|
||||
}
|
||||
|
|
|
@ -1930,12 +1930,10 @@ void nsDisplayMathMLCharBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx, const nsRect& aDirtyRect)
|
||||
{
|
||||
const nsStyleBorder* border = mStyleContext->GetStyleBorder();
|
||||
const nsStylePadding* padding = mStyleContext->GetStylePadding();
|
||||
const nsStyleBackground* backg = mStyleContext->GetStyleBackground();
|
||||
nsRect rect(mRect + aBuilder->ToReferenceFrame(mFrame));
|
||||
nsCSSRendering::PaintBackgroundWithSC(mFrame->PresContext(), *aCtx, mFrame,
|
||||
aDirtyRect,
|
||||
mRect + aBuilder->ToReferenceFrame(mFrame),
|
||||
*backg, *border, *padding,
|
||||
aDirtyRect, rect, *backg, *border,
|
||||
PR_TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -1206,5 +1206,5 @@ nsBCTableCellFrame::PaintBackground(nsIRenderingContext& aRenderingContext,
|
|||
nsCSSRendering::PaintBackgroundWithSC(PresContext(), aRenderingContext, this,
|
||||
aDirtyRect, rect,
|
||||
*GetStyleBackground(), myBorder,
|
||||
*GetStylePadding(), PR_TRUE, nsnull);
|
||||
PR_TRUE, nsnull);
|
||||
}
|
||||
|
|
|
@ -240,8 +240,6 @@ TableBackgroundPainter::TableBackgroundPainter(nsTableFrame* aTableFrame,
|
|||
mZeroBorder.SetBorderWidth(side, 0);
|
||||
}
|
||||
|
||||
mZeroPadding.RecalcData();
|
||||
|
||||
mIsBorderCollapse = aTableFrame->IsBorderCollapse();
|
||||
#ifdef DEBUG
|
||||
mCompatMode = mPresContext->CompatibilityMode();
|
||||
|
@ -320,7 +318,7 @@ TableBackgroundPainter::PaintTableFrame(nsTableFrame* aTableFrame,
|
|||
tableData.mRect + mRenderPt,
|
||||
*tableData.mBackground,
|
||||
*tableData.mBorder,
|
||||
mZeroPadding, PR_TRUE);
|
||||
PR_TRUE);
|
||||
}
|
||||
tableData.Destroy(mPresContext);
|
||||
return NS_OK;
|
||||
|
@ -625,7 +623,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
mCols[colIndex].mColGroup->mRect + mRenderPt,
|
||||
*mCols[colIndex].mColGroup->mBackground,
|
||||
*mCols[colIndex].mColGroup->mBorder,
|
||||
mZeroPadding, PR_TRUE, &mCellRect);
|
||||
PR_TRUE, &mCellRect);
|
||||
}
|
||||
|
||||
//Paint column background
|
||||
|
@ -635,7 +633,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
mCols[colIndex].mCol.mRect + mRenderPt,
|
||||
*mCols[colIndex].mCol.mBackground,
|
||||
*mCols[colIndex].mCol.mBorder,
|
||||
mZeroPadding, PR_TRUE, &mCellRect);
|
||||
PR_TRUE, &mCellRect);
|
||||
}
|
||||
|
||||
//Paint row group background
|
||||
|
@ -644,7 +642,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
mRowGroup.mFrame, mDirtyRect,
|
||||
mRowGroup.mRect + mRenderPt,
|
||||
*mRowGroup.mBackground, *mRowGroup.mBorder,
|
||||
mZeroPadding, PR_TRUE, &mCellRect);
|
||||
PR_TRUE, &mCellRect);
|
||||
}
|
||||
|
||||
//Paint row background
|
||||
|
@ -653,7 +651,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
mRow.mFrame, mDirtyRect,
|
||||
mRow.mRect + mRenderPt,
|
||||
*mRow.mBackground, *mRow.mBorder,
|
||||
mZeroPadding, PR_TRUE, &mCellRect);
|
||||
PR_TRUE, &mCellRect);
|
||||
}
|
||||
|
||||
//Paint cell background in border-collapse unless we're just passing
|
||||
|
|
|
@ -241,10 +241,7 @@ class TableBackgroundPainter
|
|||
TableBackgroundData mRow; //current row
|
||||
nsRect mCellRect; //current cell's rect
|
||||
|
||||
|
||||
nsStyleBorder mZeroBorder; //cached zero-width border
|
||||
nsStylePadding mZeroPadding; //cached zero-width padding
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3842,13 +3842,11 @@ nsTreeBodyFrame::PaintBackgroundLayer(nsStyleContext* aStyleContext,
|
|||
{
|
||||
const nsStyleBackground* myColor = aStyleContext->GetStyleBackground();
|
||||
const nsStyleBorder* myBorder = aStyleContext->GetStyleBorder();
|
||||
const nsStylePadding* myPadding = aStyleContext->GetStylePadding();
|
||||
const nsStyleOutline* myOutline = aStyleContext->GetStyleOutline();
|
||||
|
||||
nsCSSRendering::PaintBackgroundWithSC(aPresContext, aRenderingContext,
|
||||
this, aDirtyRect, aRect,
|
||||
*myColor, *myBorder, *myPadding,
|
||||
PR_TRUE);
|
||||
*myColor, *myBorder, PR_TRUE);
|
||||
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
||||
aDirtyRect, aRect, *myBorder, mStyleContext);
|
||||
|
|
Загрузка…
Ссылка в новой задаче