Bug 929441 - Stop unnecessarily setting a transform between emitting a path and stroking it. r=Bas
authorJonathan Watt <jwatt@jwatt.org>
Tue, 22 Oct 2013 23:45:51 +0200
changeset 151674 a8680e083efa3aff99342f19b6bfbcf62c6ae0fb
parent 151673 b011488de9e6e3c4fbf4acfd1fd582addcb7a9d1
child 151675 39f4bb8c55d8dd95f07d53fd79cc4d35957d226e
push id35280
push userjwatt@jwatt.org
push dateTue, 22 Oct 2013 21:46:30 +0000
treeherdermozilla-inbound@39f4bb8c55d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs929441
milestone27.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
Bug 929441 - Stop unnecessarily setting a transform between emitting a path and stroking it. r=Bas
layout/svg/nsSVGUtils.cpp
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -1647,17 +1647,20 @@ nsSVGUtils::SetupCairoStrokeBBoxGeometry
                                          gfxTextContextPaint *aContextPaint)
 {
   float width = GetStrokeWidth(aFrame, aContextPaint);
   if (width <= 0)
     return;
   aContext->SetLineWidth(width);
 
   // Apply any stroke-specific transform
-  aContext->Multiply(GetStrokeTransform(aFrame));
+  gfxMatrix strokeTransform = GetStrokeTransform(aFrame);
+  if (!strokeTransform.IsIdentity()) {
+    aContext->Multiply(strokeTransform);
+  }
 
   const nsStyleSVG* style = aFrame->StyleSVG();
   
   switch (style->mStrokeLinecap) {
   case NS_STYLE_STROKE_LINECAP_BUTT:
     aContext->SetLineCap(gfxContext::LINE_CAP_BUTT);
     break;
   case NS_STYLE_STROKE_LINECAP_ROUND: