Closed Bug 955917 Opened 11 years ago Closed 11 years ago

Remove unused functions from nsSVGUtils

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: longsonr, Assigned: longsonr)

Details

Attachments

(2 files)

Attached patch utils.txtSplinter Review
      No description provided.
Assignee: nobody → longsonr
OS: Windows Vista → All
Hardware: x86 → All
Attachment #8355071 - Attachment is patch: true
Attachment #8355071 - Flags: review?(dholbert)
It looks like nsSVGUtils::SetupContextPaint (made into a private-to-nsSVGUtils.cpp function in this patch) is actually near-identical to SVGTextFrame::SetupContextPaint().

Seems like maybe we should keep the nsSVGUtils method public, and (perhaps in a separate bug) make SVGTextFrame share its code rather than reimplementing it.
Comment on attachment 8355071 [details] [diff] [review]
utils.txt

Definitely r=me on the rest, though (the non-SetupContextPaint-related, strictly-code-removal parts.

Let's hold off on the SetupContextPaint tweak for now, since per above, I think there may be reasons to keep that function public.
Attachment #8355071 - Flags: review?(dholbert) → review+
Whiteboard: [leave open]
Attached patch part 2Splinter Review
Attachment #8355196 - Flags: review?(dholbert)
Comment on attachment 8355196 [details] [diff] [review]
part 2

>diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp
>--- a/layout/svg/SVGTextFrame.cpp
>+++ b/layout/svg/SVGTextFrame.cpp
>@@ -5582,56 +5582,26 @@ SVGTextFrame::SetupInheritablePaint(gfxC
>                                     const FramePropertyDescriptor* aProperty)
> {
>   const nsStyleSVG *style = aFrame->StyleSVG();
>   nsSVGPaintServerFrame *ps =
>     nsSVGEffects::GetPaintServer(aFrame, &(style->*aFillOrStroke), aProperty);
> 
>   if (ps && ps->SetupPaintServer(aContext, aFrame, aFillOrStroke, aOpacity)) {
>     aTargetPaint.SetPaintServer(aFrame, aContext->CurrentMatrix(), ps);
>-  } else if (SetupContextPaint(aContext, aFrame, aFillOrStroke, aOpacity, aOuterContextPaint)) {
>+  } else if (nsSVGUtils::SetupContextPaint(aContext, aOuterContextPaint,
>+                                           aFrame->StyleSVG()->*aFillOrStroke,

We already looked up StyleSVG() above, so this last line can just be:
 style->*aFillOrStroke

r=me with that

Optional: I'd marginally prefer to have this part split this out from the second half of this patch (dropping PathExtentsToMaxStrokeExtents), because a function-swap is functionally different from unused-code-removal. (It's also conceivable that we'd want to back out the first piece, e.g. if the SetupContextPaint functions were subtly different in a way that we didn't notice; in that case, we wouldn't want to back out the second piece).

If you do that, r=me on both pieces.
Attachment #8355196 - Flags: review?(dholbert) → review+
Split out into another bug or split out into another patch in this bug?
I just meant a separate patch (in this bug is fine).
https://hg.mozilla.org/mozilla-central/rev/df7e0f8fa993
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: