Bug 1385861 - Part 3. Rename nsSVGUtils::SetupCairoStrokeGeometry as nsSVGUtils::SetupStrokeGeometry. draft
authorcku <cku@mozilla.com>
Mon, 31 Jul 2017 20:20:28 +0800
changeset 619045 ffc1421f987cd02ac47c0c6d512ce54856499f7c
parent 619044 04ed3483cbb2a42a2774118d492ff2e75508a634
child 619046 2d2f051f435b8180a2c9c548552f2aa3aa8f903e
push id71556
push userbmo:cku@mozilla.com
push dateTue, 01 Aug 2017 13:55:40 +0000
bugs1385861
milestone56.0a1
Bug 1385861 - Part 3. Rename nsSVGUtils::SetupCairoStrokeGeometry as nsSVGUtils::SetupStrokeGeometry. (This patch is not relative to performance) Rename this function since it has not relation with cario at all. MozReview-Commit-ID: DHvrsVZAJ7B
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGUtils.cpp
layout/svg/nsSVGUtils.h
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -3669,17 +3669,17 @@ SVGTextFrame::PaintSVG(gfxContext& aCont
     DrawMode drawMode = contextPaint->Init(&aDrawTarget,
                                            aContext.CurrentMatrix(),
                                            frame, outerContextPaint,
                                            aImgParams);
     if (drawMode & DrawMode::GLYPH_STROKE) {
       ctxSR.EnsureSaved(&aContext);
       // This may change the gfxContext's transform (for non-scaling stroke),
       // in which case this needs to happen before we call SetMatrix() below.
-      nsSVGUtils::SetupCairoStrokeGeometry(frame, &aContext, outerContextPaint);
+      nsSVGUtils::SetupStrokeGeometry(frame, &aContext, outerContextPaint);
     }
 
     // Set up the transform for painting the text frame for the substring
     // indicated by the run.
     gfxMatrix runTransform =
       run.GetTransformFromUserSpaceForPainting(presContext, item) *
       currentMatrix;
     aContext.SetMatrix(runTransform);
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -1720,19 +1720,19 @@ GetStrokeDashData(nsIFrame* aFrame,
     *aDashOffset = SVGContentUtils::CoordToFloat(ctx,
                                                  style->mStrokeDashoffset);
   }
 
   return (totalLength > 0.0);
 }
 
 void
-nsSVGUtils::SetupCairoStrokeGeometry(nsIFrame* aFrame,
-                                     gfxContext *aContext,
-                                     SVGContextPaint* aContextPaint)
+nsSVGUtils::SetupStrokeGeometry(nsIFrame* aFrame,
+                                gfxContext *aContext,
+                                SVGContextPaint* aContextPaint)
 {
   float width = GetStrokeWidth(aFrame, aContextPaint);
   if (width <= 0)
     return;
   aContext->SetLineWidth(width);
 
   // Apply any stroke-specific transform
   gfxMatrix outerSVGToUser;
--- a/layout/svg/nsSVGUtils.h
+++ b/layout/svg/nsSVGUtils.h
@@ -527,20 +527,19 @@ public:
    */
   static bool HasStroke(nsIFrame* aFrame,
                         SVGContextPaint* aContextPaint = nullptr);
 
   static float GetStrokeWidth(nsIFrame* aFrame,
                               SVGContextPaint* aContextPaint = nullptr);
 
   /*
-   * Set up a cairo context for a stroked path (including any dashing that
-   * applies).
+   * Set up a context for a stroked path (including any dashing that applies).
    */
-  static void SetupCairoStrokeGeometry(nsIFrame* aFrame, gfxContext *aContext,
+  static void SetupStrokeGeometry(nsIFrame* aFrame, gfxContext *aContext,
                                        SVGContextPaint* 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.
    */