Bug 725918 patch 1: Fixed code style in nsSVGGlyphFrame::SetupCairoState. r=longsonr
authorEdwin Flores <eflores@mozilla.com>
Fri, 17 Feb 2012 16:33:00 -0800
changeset 87142 829fa4d266ac74d60ec7c099e2756999f4050b00
parent 87141 50aae34555bb0032ccfffe4a2b362a1ee6f703e9
child 87143 f89c186b8143099fa452fe900ca942f5cbc5690c
push id22083
push userbmo@edmorley.co.uk
push dateSat, 18 Feb 2012 11:19:19 +0000
treeherdermozilla-central@20478b673212 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs725918
milestone13.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 725918 patch 1: Fixed code style in nsSVGGlyphFrame::SetupCairoState. r=longsonr
layout/svg/base/src/nsSVGGlyphFrame.cpp
layout/svg/base/src/nsSVGGlyphFrame.h
--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
@@ -879,49 +879,50 @@ nsSVGGlyphFrame::GetBaselineOffset(float
   default:
     NS_WARNING("We don't know about this type of dominant-baseline");
     return 0.0;
   }
   return baselineAppUnits * aMetricsScale;
 }
 
 DrawMode
-nsSVGGlyphFrame::SetupCairoState(gfxContext *context, nsRefPtr<gfxPattern> *strokePattern) {
+nsSVGGlyphFrame::SetupCairoState(gfxContext *aContext, nsRefPtr<gfxPattern> *aStrokePattern)
+{
   DrawMode toDraw = DrawMode(0);
   const nsStyleSVG* style = GetStyleSVG();
 
   if (HasStroke()) {
-    gfxContextMatrixAutoSaveRestore matrixRestore(context);
-    context->IdentityMatrix();
+    gfxContextMatrixAutoSaveRestore matrixRestore(aContext);
+    aContext->IdentityMatrix();
 
     toDraw = DrawMode(toDraw | gfxFont::GLYPH_STROKE);
 
-    SetupCairoStrokeHitGeometry(context);
+    SetupCairoStrokeHitGeometry(aContext);
     float opacity = style->mStrokeOpacity;
     nsSVGPaintServerFrame *ps = GetPaintServer(&style->mStroke,
                                                nsSVGEffects::StrokeProperty());
 
     if (ps) {
       // Gradient or Pattern: can get pattern directly from frame
-      *strokePattern = ps->GetPaintServerPattern(this, opacity);
+      *aStrokePattern = ps->GetPaintServerPattern(this, opacity);
 
-      NS_ASSERTION(*strokePattern, "No pattern returned from paint server");
+      NS_ASSERTION(*aStrokePattern, "No pattern returned from paint server");
     } else {
       nscolor color;
-      nsSVGUtils::GetFallbackOrPaintColor(context, GetStyleContext(),
+      nsSVGUtils::GetFallbackOrPaintColor(aContext, GetStyleContext(),
                                           &nsStyleSVG::mStroke, &opacity,
                                           &color);
-      *strokePattern = new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
+      *aStrokePattern = new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
                                               NS_GET_G(color) / 255.0,
                                               NS_GET_B(color) / 255.0,
                                               NS_GET_A(color) / 255.0 * opacity));
     }
   }
 
-  if (SetupCairoFill(context)) {
+  if (SetupCairoFill(aContext)) {
     toDraw = DrawMode(toDraw | gfxFont::GLYPH_FILL);
   }
 
   return toDraw;
 }
 
 //----------------------------------------------------------------------
 
--- a/layout/svg/base/src/nsSVGGlyphFrame.h
+++ b/layout/svg/base/src/nsSVGGlyphFrame.h
@@ -263,12 +263,13 @@ protected:
   gfxPoint mPosition;
   // The start index into the position and rotation data
   PRUint32 mStartIndex;
   bool mCompressWhitespace;
   bool mTrimLeadingWhitespace;
   bool mTrimTrailingWhitespace;
 
 private:
-  DrawMode SetupCairoState(gfxContext *context, nsRefPtr<gfxPattern> *strokePattern);
+  DrawMode SetupCairoState(gfxContext *aContext,
+                           nsRefPtr<gfxPattern> *aStrokePattern);
 };
 
 #endif