зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset a44640701558 (bug 1323912)
This commit is contained in:
Родитель
c8e876e89c
Коммит
53e5ead7ef
|
@ -1808,7 +1808,7 @@ nsCSSRendering::PaintBGParams::ForSingleLayer(nsPresContext& aPresCtx,
|
|||
}
|
||||
|
||||
DrawResult
|
||||
nsCSSRendering::PaintStyleImageLayer(const PaintBGParams& aParams)
|
||||
nsCSSRendering::PaintBackground(const PaintBGParams& aParams)
|
||||
{
|
||||
PROFILER_LABEL("nsCSSRendering", "PaintBackground",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
@ -1835,7 +1835,7 @@ nsCSSRendering::PaintStyleImageLayer(const PaintBGParams& aParams)
|
|||
sc = aParams.frame->StyleContext();
|
||||
}
|
||||
|
||||
return PaintStyleImageLayerWithSC(aParams, sc, *aParams.frame->StyleBorder());
|
||||
return PaintBackgroundWithSC(aParams, sc, *aParams.frame->StyleBorder());
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -3243,9 +3243,9 @@ DetermineCompositionOp(const nsCSSRendering::PaintBGParams& aParams,
|
|||
}
|
||||
|
||||
DrawResult
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
|
||||
nsStyleContext *aBackgroundSC,
|
||||
const nsStyleBorder& aBorder)
|
||||
nsCSSRendering::PaintBackgroundWithSC(const PaintBGParams& aParams,
|
||||
nsStyleContext *aBackgroundSC,
|
||||
const nsStyleBorder& aBorder)
|
||||
{
|
||||
NS_PRECONDITION(aParams.frame,
|
||||
"Frame is expected to be provided to PaintBackground");
|
||||
|
@ -3448,12 +3448,12 @@ nsCSSRendering::PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
|
|||
}
|
||||
|
||||
result &=
|
||||
state.mImageRenderer.DrawLayer(&aParams.presCtx,
|
||||
aParams.renderingCtx,
|
||||
state.mDestArea, state.mFillArea,
|
||||
state.mAnchor + paintBorderArea.TopLeft(),
|
||||
clipState.mDirtyRect,
|
||||
state.mRepeatSize);
|
||||
state.mImageRenderer.DrawBackground(&aParams.presCtx,
|
||||
aParams.renderingCtx,
|
||||
state.mDestArea, state.mFillArea,
|
||||
state.mAnchor + paintBorderArea.TopLeft(),
|
||||
clipState.mDirtyRect,
|
||||
state.mRepeatSize);
|
||||
|
||||
if (co != CompositionOp::OP_OVER) {
|
||||
ctx->SetOp(CompositionOp::OP_OVER);
|
||||
|
@ -5786,13 +5786,13 @@ nsImageRenderer::DrawableForElement(const nsRect& aImageRect,
|
|||
}
|
||||
|
||||
DrawResult
|
||||
nsImageRenderer::DrawLayer(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
const nsRect& aDest,
|
||||
const nsRect& aFill,
|
||||
const nsPoint& aAnchor,
|
||||
const nsRect& aDirty,
|
||||
const nsSize& aRepeatSize)
|
||||
nsImageRenderer::DrawBackground(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
const nsRect& aDest,
|
||||
const nsRect& aFill,
|
||||
const nsPoint& aAnchor,
|
||||
const nsRect& aDirty,
|
||||
const nsSize& aRepeatSize)
|
||||
{
|
||||
if (!IsReady()) {
|
||||
NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
* definitions from the CSS Image Values and Replaced Content spec. See
|
||||
* http://dev.w3.org/csswg/css-images-3/#sizing .
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Compute the intrinsic size of the image as defined in the CSS Image Values
|
||||
* spec. The intrinsic size is the unscaled size which the image would ideally
|
||||
|
@ -209,17 +209,17 @@ public:
|
|||
const nsSize& aDefaultSize);
|
||||
|
||||
/**
|
||||
* Draws the image to the target rendering context using
|
||||
* {background|mask}-specific arguments.
|
||||
* Draws the image to the target rendering context using background-specific
|
||||
* arguments.
|
||||
* @see nsLayoutUtils::DrawImage() for parameters.
|
||||
*/
|
||||
DrawResult DrawLayer(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
const nsRect& aDest,
|
||||
const nsRect& aFill,
|
||||
const nsPoint& aAnchor,
|
||||
const nsRect& aDirty,
|
||||
const nsSize& aRepeatSize);
|
||||
DrawResult DrawBackground(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
const nsRect& aDest,
|
||||
const nsRect& aFill,
|
||||
const nsPoint& aAnchor,
|
||||
const nsRect& aDirty,
|
||||
const nsSize& aRepeatSize);
|
||||
|
||||
/**
|
||||
* Draw the image to a single component of a border-image style rendering.
|
||||
|
@ -669,25 +669,24 @@ struct nsCSSRendering {
|
|||
compositionOp(aCompositionOp) {}
|
||||
};
|
||||
|
||||
static DrawResult PaintStyleImageLayer(const PaintBGParams& aParams);
|
||||
static DrawResult PaintBackground(const PaintBGParams& aParams);
|
||||
|
||||
|
||||
/**
|
||||
* Same as |PaintStyleImageLayer|, except using the provided style structs.
|
||||
* Same as |PaintBackground|, except using the provided style structs.
|
||||
* This short-circuits the code that ensures that the root element's
|
||||
* {background|mask} is drawn on the canvas.
|
||||
* The aLayer parameter allows you to paint a single layer of the
|
||||
* {background|mask}.
|
||||
* background is drawn on the canvas.
|
||||
* The aLayer parameter allows you to paint a single layer of the background.
|
||||
* The default value for aLayer, -1, means that all layers will be painted.
|
||||
* The background color will only be painted if the back-most layer is also
|
||||
* being painted and (aParams.paintFlags & PAINTBG_MASK_IMAGE) is false.
|
||||
* being painted.
|
||||
* aCompositionOp is only respected if a single layer is specified (aLayer != -1).
|
||||
* If all layers are painted, the image layer's blend mode (or the mask
|
||||
* layer's composition mode) will be used.
|
||||
*/
|
||||
static DrawResult PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
|
||||
nsStyleContext *mBackgroundSC,
|
||||
const nsStyleBorder& aBorder);
|
||||
static DrawResult PaintBackgroundWithSC(const PaintBGParams& aParams,
|
||||
nsStyleContext *mBackgroundSC,
|
||||
const nsStyleBorder& aBorder);
|
||||
|
||||
/**
|
||||
* Returns the rectangle covered by the given background layer image, taking
|
||||
|
|
|
@ -3249,7 +3249,7 @@ nsDisplayBackgroundImage::PaintInternal(nsDisplayListBuilder* aBuilder,
|
|||
CompositionOp::OP_OVER);
|
||||
params.bgClipRect = aClipRect;
|
||||
image::DrawResult result =
|
||||
nsCSSRendering::PaintStyleImageLayer(params);
|
||||
nsCSSRendering::PaintBackground(params);
|
||||
|
||||
if (clip == StyleGeometryBox::Text) {
|
||||
ctx->PopGroupAndBlend();
|
||||
|
|
|
@ -512,7 +512,7 @@ PaintMaskSurface(const PaintFramesParams& aParams,
|
|||
i, compositionOp);
|
||||
|
||||
result =
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params, aSC,
|
||||
nsCSSRendering::PaintBackgroundWithSC(params, aSC,
|
||||
*aParams.frame->StyleBorder());
|
||||
if (result != DrawResult::SUCCESS) {
|
||||
return result;
|
||||
|
|
|
@ -376,7 +376,7 @@ nsTableCellFrame::PaintBackground(nsRenderingContext& aRenderingContext,
|
|||
aRenderingContext,
|
||||
aDirtyRect, rect,
|
||||
this, aFlags);
|
||||
return nsCSSRendering::PaintStyleImageLayer(params);
|
||||
return nsCSSRendering::PaintBackground(params);
|
||||
}
|
||||
|
||||
// Called by nsTablePainter
|
||||
|
@ -1204,6 +1204,7 @@ nsBCTableCellFrame::GetBorderOverflow()
|
|||
return halfBorder.GetPhysicalMargin(wm);
|
||||
}
|
||||
|
||||
|
||||
DrawResult
|
||||
nsBCTableCellFrame::PaintBackground(nsRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
|
@ -1229,6 +1230,5 @@ nsBCTableCellFrame::PaintBackground(nsRenderingContext& aRenderingContext,
|
|||
aRenderingContext, aDirtyRect,
|
||||
rect, this,
|
||||
aFlags);
|
||||
return nsCSSRendering::PaintStyleImageLayerWithSC(params, StyleContext(),
|
||||
myBorder);
|
||||
return nsCSSRendering::PaintBackgroundWithSC(params, StyleContext(), myBorder);
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ TableBackgroundPainter::PaintTableFrame(nsTableFrame* aTableFrame,
|
|||
mBGPaintFlags);
|
||||
|
||||
result &=
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params,
|
||||
nsCSSRendering::PaintBackgroundWithSC(params,
|
||||
tableData.mFrame->StyleContext(),
|
||||
tableData.StyleBorder(mZeroBorder));
|
||||
}
|
||||
|
@ -580,7 +580,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
mBGPaintFlags);
|
||||
params.bgClipRect = &aColBGRect;
|
||||
result &=
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params,
|
||||
nsCSSRendering::PaintBackgroundWithSC(params,
|
||||
mCols[colIndex].mColGroup.mFrame->StyleContext(),
|
||||
mCols[colIndex].mColGroup.StyleBorder(mZeroBorder));
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
mBGPaintFlags);
|
||||
params.bgClipRect = &aColBGRect;
|
||||
result &=
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params,
|
||||
nsCSSRendering::PaintBackgroundWithSC(params,
|
||||
mCols[colIndex].mCol.mFrame->StyleContext(),
|
||||
mCols[colIndex].mCol.StyleBorder(mZeroBorder));
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
aRowGroupBGData.mFrame, mBGPaintFlags);
|
||||
params.bgClipRect = &aRowGroupBGRect;
|
||||
result &=
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params,
|
||||
nsCSSRendering::PaintBackgroundWithSC(params,
|
||||
aRowGroupBGData.mFrame->StyleContext(),
|
||||
aRowGroupBGData.StyleBorder(mZeroBorder));
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
aRowBGData.mFrame, mBGPaintFlags);
|
||||
params.bgClipRect = &aRowBGRect;
|
||||
result &=
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params,
|
||||
nsCSSRendering::PaintBackgroundWithSC(params,
|
||||
aRowBGData.mFrame->StyleContext(),
|
||||
aRowBGData.StyleBorder(mZeroBorder));
|
||||
}
|
||||
|
|
|
@ -4149,8 +4149,7 @@ nsTreeBodyFrame::PaintBackgroundLayer(nsStyleContext* aStyleContext,
|
|||
aDirtyRect, aRect, this,
|
||||
nsCSSRendering::PAINTBG_SYNC_DECODE_IMAGES);
|
||||
DrawResult result =
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params, aStyleContext,
|
||||
*myBorder);
|
||||
nsCSSRendering::PaintBackgroundWithSC(params, aStyleContext, *myBorder);
|
||||
|
||||
result &=
|
||||
nsCSSRendering::PaintBorderWithStyleBorder(aPresContext, aRenderingContext,
|
||||
|
|
Загрузка…
Ссылка в новой задаче