Bug 1385861 - Part 1. Remove redundant gfxContext::Save/Restore in nsDisplaySVGText::Paint.
nsDisplaySVGText::Paint calls SVGTextFrame::PaintSVG, and we already save/restore
context state in SVGTextFrame::PaintSVG.
I also filed
Bug 1385929 to find a solution to prevent duplicated
gfxContext::Save/Restore.
MozReview-Commit-ID: 4WxdFZzvmvF
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -3127,23 +3127,21 @@ nsDisplaySVGText::Paint(nsDisplayListBui
gfxPoint devPixelOffset =
nsLayoutUtils::PointToGfxPoint(offset, appUnitsPerDevPixel);
gfxMatrix tm = nsSVGUtils::GetCSSPxToDevPxMatrix(mFrame) *
gfxMatrix::Translation(devPixelOffset);
gfxContext* ctx = aCtx;
- ctx->Save();
imgDrawingParams imgParams(aBuilder->ShouldSyncDecodeImages()
? imgIContainer::FLAG_SYNC_DECODE
: imgIContainer::FLAG_SYNC_DECODE_IF_FAST);
static_cast<SVGTextFrame*>(mFrame)->PaintSVG(*ctx, tm, imgParams);
nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, imgParams.result);
- ctx->Restore();
}
// ---------------------------------------------------------------------
// nsQueryFrame methods
NS_QUERYFRAME_HEAD(SVGTextFrame)
NS_QUERYFRAME_ENTRY(SVGTextFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsSVGDisplayContainerFrame)