Bug 892966 - Setup dashing correctly in DrawTargetCG::StrokeRect. r=jrmuizel
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 12 Jul 2013 17:19:28 -0400
changeset 138759 1dcbef737c1ed786e8693739b27456a948a56f3d
parent 138758 97bd67a11baa57f43acd1cf9fb6bb22266b54329
child 138760 1bd8fb49312194a33d6654486de337fa00e38964
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersjrmuizel
bugs892966
milestone25.0a1
Bug 892966 - Setup dashing correctly in DrawTargetCG::StrokeRect. r=jrmuizel
gfx/2d/DrawTargetCG.cpp
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -630,32 +630,17 @@ DrawTargetCG::StrokeRect(const Rect &aRe
 
   UnboundnessFixer fixer;
   CGContextRef cg = fixer.Check(mCg, aDrawOptions.mCompositionOp);
   CGContextSetAlpha(mCg, aDrawOptions.mAlpha);
   CGContextSetBlendMode(mCg, ToBlendMode(aDrawOptions.mCompositionOp));
 
   CGContextConcatCTM(cg, GfxMatrixToCGAffineTransform(mTransform));
 
-  // we don't need to set all of the stroke state because
-  // it doesn't apply when stroking rects
-  switch (aStrokeOptions.mLineJoin)
-  {
-    case JOIN_BEVEL:
-      CGContextSetLineJoin(cg, kCGLineJoinBevel);
-      break;
-    case JOIN_ROUND:
-      CGContextSetLineJoin(cg, kCGLineJoinRound);
-      break;
-    case JOIN_MITER:
-    case JOIN_MITER_OR_BEVEL:
-      CGContextSetLineJoin(cg, kCGLineJoinMiter);
-      break;
-  }
-  CGContextSetLineWidth(cg, aStrokeOptions.mLineWidth);
+  SetStrokeOptions(cg, aStrokeOptions);
 
   if (isGradient(aPattern)) {
     // There's no CGContextClipStrokeRect so we do it by hand
     CGContextBeginPath(cg);
     CGContextAddRect(cg, RectToCGRect(aRect));
     CGContextReplacePathWithStrokedPath(cg);
     //XXX: should we use EO clip here?
     CGContextClip(cg);