mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1224207 - Part 5. Fine tune nsFilterInstance::BuildSourcePaint. r=mstange
1. Rename gfx->sourceCtx. 2. Since sourceCtx is discarded immidiately, there is no need of save/restore. MozReview-Commit-ID: CM2MMBYWp3W --HG-- extra : rebase_source : 059f205b65632984cfaed535348ae702501d10d8
This commit is contained in:
parent
1ac1d6737d
commit
36512021da
@ -383,23 +383,21 @@ nsFilterInstance::BuildSourcePaint(SourceInfo *aSource)
|
||||
"(nsFilterInstance::Render)");
|
||||
|
||||
if (!mPaintTransform.IsSingular()) {
|
||||
RefPtr<gfxContext> gfx = gfxContext::CreateOrNull(offscreenDT);
|
||||
MOZ_ASSERT(gfx); // already checked the draw target above
|
||||
gfx->Save();
|
||||
gfx->Multiply(mPaintTransform *
|
||||
RefPtr<gfxContext> sourceCtx = gfxContext::CreateOrNull(offscreenDT);
|
||||
MOZ_ASSERT(sourceCtx); // already checked the draw target above
|
||||
sourceCtx->Multiply(mPaintTransform *
|
||||
deviceToFilterSpace *
|
||||
gfxMatrix::Translation(-neededRect.TopLeft()));
|
||||
GeneralPattern pattern;
|
||||
if (aSource == &mFillPaint) {
|
||||
nsSVGUtils::MakeFillPatternFor(mTargetFrame, gfx, &pattern);
|
||||
nsSVGUtils::MakeFillPatternFor(mTargetFrame, sourceCtx, &pattern);
|
||||
} else if (aSource == &mStrokePaint) {
|
||||
nsSVGUtils::MakeStrokePatternFor(mTargetFrame, gfx, &pattern);
|
||||
nsSVGUtils::MakeStrokePatternFor(mTargetFrame, sourceCtx, &pattern);
|
||||
}
|
||||
if (pattern.GetPattern()) {
|
||||
offscreenDT->FillRect(ToRect(FilterSpaceToUserSpace(ThebesRect(neededRect))),
|
||||
pattern);
|
||||
}
|
||||
gfx->Restore();
|
||||
}
|
||||
|
||||
aSource->mSourceSurface = offscreenDT->Snapshot();
|
||||
|
Loading…
Reference in New Issue
Block a user