Bug 1300401 - Part 2. Add more comments and assertions. r=mstange

MozReview-Commit-ID: HywA9IrGhk2

--HG--
extra : rebase_source : 27dce66ccb4b0547b9c6332ebde99ebdc272565a
This commit is contained in:
cku 2016-09-05 12:46:56 +08:00
parent 86c378df38
commit 56e3bcbb89
2 changed files with 10 additions and 2 deletions

View File

@ -2442,7 +2442,8 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
*/
if (usingSVGEffects) {
MOZ_ASSERT(StyleEffects()->HasFilters() ||
nsSVGIntegrationUtils::UsingMaskOrClipPathForFrame(this));
nsSVGIntegrationUtils::UsingMaskOrClipPathForFrame(this),
"Beside filter & mask/clip-path, what else effect do we have?");
if (clipCapturedBy == ContainerItemType::eSVGEffects) {
clipState.ExitStackingContextContents(&containerItemScrollClip);

View File

@ -752,6 +752,10 @@ BlendToTarget(const nsSVGIntegrationUtils::PaintFramesParams& aParams,
DrawResult
nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
{
MOZ_ASSERT(UsingMaskOrClipPathForFrame(aParams.frame),
"Should not use this method when no mask or clipPath effect"
"on this frame");
/* SVG defines the following rendering model:
*
* 1. Render geometry
@ -920,7 +924,10 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
DrawResult
nsSVGIntegrationUtils::PaintFilter(const PaintFramesParams& aParams)
{
MOZ_ASSERT(!aParams.builder->IsForGenerateGlyphMask());
MOZ_ASSERT(!aParams.builder->IsForGenerateGlyphMask(),
"Filter effect is discarded while generating glyph mask.");
MOZ_ASSERT(aParams.frame->StyleEffects()->HasFilters(),
"Should not use this method when no filter effect on this frame");
nsIFrame* frame = aParams.frame;
DrawResult result = DrawResult::SUCCESS;