author | Jonathan Watt <jwatt@jwatt.org> |
Mon, 29 Sep 2014 14:12:07 +0100 | |
changeset 207646 | 467d08aeefd06189a9aa82602fef91d1e8e3bfb1 |
parent 207645 | 0218b4fe7bbb89904c95828343d377f57c1428f0 |
child 207647 | 2a2dbc54318e65e10f26393494ae4e385eaae429 |
push id | 49746 |
push user | jwatt@jwatt.org |
push date | Mon, 29 Sep 2014 13:14:10 +0000 |
treeherder | mozilla-inbound@467d08aeefd0 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | longsonr |
bugs | 1073854 |
milestone | 35.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -2969,21 +2969,27 @@ SVGTextDrawPathCallbacks::FillGeometry() gfx->SetFillRule(nsSVGUtils::ThebesFillRule(mFrame->StyleSVG()->mFillRule)); gfx->Fill(); } } void SVGTextDrawPathCallbacks::StrokeGeometry() { + // We don't paint the stroke when we are filling with a selection color. if (mColor == NS_SAME_AS_FOREGROUND_COLOR || mColor == NS_40PERCENT_FOREGROUND_COLOR) { - // Don't paint the stroke when we are filling with a selection color. - if (nsSVGUtils::SetupCairoStroke(mFrame, gfx)) { - gfx->Stroke(); + if (nsSVGUtils::HasStroke(mFrame, /*aContextPaint*/ nullptr)) { + nsRefPtr<gfxPattern> strokePattern = + nsSVGUtils::MakeStrokePatternFor(mFrame, gfx, /*aContextPaint*/ nullptr); + if (strokePattern) { + nsSVGUtils::SetupCairoStrokeGeometry(mFrame, gfx, /*aContextPaint*/ nullptr); + gfx->SetPattern(strokePattern); + gfx->Stroke(); + } } } } //---------------------------------------------------------------------- // SVGTextContextPaint methods: already_AddRefed<gfxPattern>
--- a/layout/svg/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/nsSVGPathGeometryFrame.cpp @@ -690,18 +690,24 @@ nsSVGPathGeometryFrame::Render(nsRenderi if (fillPattern) { gfx->SetPattern(fillPattern); gfx->SetFillRule(nsSVGUtils::ThebesFillRule(StyleSVG()->mFillRule)); gfx->Fill(); } } if ((aRenderComponents & eRenderStroke) && - nsSVGUtils::SetupCairoStroke(this, gfx, contextPaint)) { - gfx->Stroke(); + nsSVGUtils::HasStroke(this, contextPaint)) { + nsRefPtr<gfxPattern> strokePattern = + nsSVGUtils::MakeStrokePatternFor(this, gfx, contextPaint); + if (strokePattern) { + nsSVGUtils::SetupCairoStrokeGeometry(this, gfx, contextPaint); + gfx->SetPattern(strokePattern); + gfx->Stroke(); + } } gfx->NewPath(); } void nsSVGPathGeometryFrame::GeneratePath(gfxContext* aContext, const Matrix &aTransform)
--- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -1577,34 +1577,16 @@ nsSVGUtils::GetGeometryHitTestFlags(nsIF NS_ERROR("not reached"); break; } return flags; } bool -nsSVGUtils::SetupCairoStroke(nsIFrame* aFrame, gfxContext* aContext, - gfxTextContextPaint *aContextPaint) -{ - if (!HasStroke(aFrame, aContextPaint)) { - return false; - } - SetupCairoStrokeGeometry(aFrame, aContext, aContextPaint); - - nsRefPtr<gfxPattern> pattern = - MakeStrokePatternFor(aFrame, aContext, aContextPaint); - if (pattern) { - aContext->SetPattern(pattern); - return true; - } - return false; -} - -bool nsSVGUtils::PaintSVGGlyph(Element* aElement, gfxContext* aContext, DrawMode aDrawMode, gfxTextContextPaint* aContextPaint) { nsIFrame* frame = aElement->GetPrimaryFrame(); nsISVGChildFrame* svgFrame = do_QueryFrame(frame); if (!svgFrame) { return false;
--- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -531,23 +531,16 @@ public: /* * Set up a cairo context for a stroked path (including any dashing that * applies). */ static void SetupCairoStrokeGeometry(nsIFrame* aFrame, gfxContext *aContext, gfxTextContextPaint *aContextPaint = nullptr); - /* - * Set up a cairo context for stroking, including setting up any stroke-related - * properties such as dashing and setting the current paint on the gfxContext. - */ - static bool SetupCairoStroke(nsIFrame* aFrame, gfxContext *aContext, - gfxTextContextPaint *aContextPaint = nullptr); - /** * This function returns a set of bit flags indicating which parts of the * element (fill, stroke, bounds) should intercept pointer events. It takes * into account the type of element and the value of the 'pointer-events' * property on the element. */ static uint16_t GetGeometryHitTestFlags(nsIFrame* aFrame);