зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1896711 part 2: Use MakeRefPtr to reduce boilerplate, in layout/svg. r=TYLin
Also remove one unnecessary null-check for an object that we're allocating infallibly. Differential Revision: https://phabricator.services.mozilla.com/D210388
This commit is contained in:
Родитель
65bdc0fc6f
Коммит
88d1a64077
|
@ -134,7 +134,7 @@ void SVGMarkerFrame::PaintMark(gfxContext& aContext,
|
|||
ISVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
|
||||
// The CTM of each frame referencing us may be different.
|
||||
SVGFrame->NotifySVGChanged(ISVGDisplayableFrame::TRANSFORM_CHANGED);
|
||||
RefPtr<SVGContextPaintImpl> contextPaint = new SVGContextPaintImpl();
|
||||
auto contextPaint = MakeRefPtr<SVGContextPaintImpl>();
|
||||
contextPaint->Init(aContext.GetDrawTarget(), aContext.CurrentMatrixDouble(),
|
||||
aMarkedFrame, SVGContextPaint::GetContextPaint(marker),
|
||||
aImgParams);
|
||||
|
|
|
@ -1676,8 +1676,7 @@ Element* SVGObserverUtils::GetAndObserveBackgroundImage(nsIFrame* aFrame,
|
|||
aFrame->GetContent()
|
||||
->OwnerDoc()
|
||||
->ReferrerInfoForInternalCSSAndSVGResources();
|
||||
RefPtr<URLAndReferrerInfo> url =
|
||||
new URLAndReferrerInfo(targetURI, referrerInfo);
|
||||
auto url = MakeRefPtr<URLAndReferrerInfo>(targetURI, referrerInfo);
|
||||
|
||||
return static_cast<SVGMozElementObserver*>(
|
||||
hashtable
|
||||
|
|
|
@ -688,13 +688,9 @@ already_AddRefed<gfxPattern> SVGPatternFrame::GetPaintServerPattern(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<gfxPattern> pattern = new gfxPattern(surface, pMatrix);
|
||||
|
||||
if (!pattern) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto pattern = MakeRefPtr<gfxPattern>(surface, pMatrix);
|
||||
pattern->SetExtend(ExtendMode::REPEAT);
|
||||
|
||||
return pattern.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -3142,7 +3142,7 @@ void SVGTextFrame::PaintSVG(gfxContext& aContext, const gfxMatrix& aTransform,
|
|||
while (run.mFrame) {
|
||||
nsTextFrame* frame = run.mFrame;
|
||||
|
||||
RefPtr<SVGContextPaintImpl> contextPaint = new SVGContextPaintImpl();
|
||||
auto contextPaint = MakeRefPtr<SVGContextPaintImpl>();
|
||||
DrawMode drawMode = contextPaint->Init(&aDrawTarget, initialMatrix, frame,
|
||||
outerContextPaint, aImgParams);
|
||||
if (drawMode & DrawMode::GLYPH_STROKE) {
|
||||
|
|
|
@ -513,7 +513,7 @@ class MixModeBlender {
|
|||
|
||||
gfxContextAutoSaveRestore save(mSourceCtx);
|
||||
mSourceCtx->SetMatrix(Matrix()); // This will be restored right after.
|
||||
RefPtr<gfxPattern> pattern = new gfxPattern(
|
||||
auto pattern = MakeRefPtr<gfxPattern>(
|
||||
targetSurf, Matrix::Translation(mTargetOffset.x, mTargetOffset.y));
|
||||
mSourceCtx->SetPattern(pattern);
|
||||
mSourceCtx->Paint();
|
||||
|
|
Загрузка…
Ссылка в новой задаче