Bug 725918 patch 3: Use getter_AddRefs instead of passing a pointer-to-nsRefPtr. r=jwatt
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 17 Feb 2012 16:33:24 -0800
changeset 87144 4ab82ee636d69eacf62a890562a05e764536e7e2
parent 87143 f89c186b8143099fa452fe900ca942f5cbc5690c
child 87145 e423d872f94ff6cf4635d789dacebf44076e5b35
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)
reviewersjwatt
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 3: Use getter_AddRefs instead of passing a pointer-to-nsRefPtr. r=jwatt
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
@@ -369,17 +369,17 @@ nsSVGGlyphFrame::PaintSVG(nsSVGRenderSta
   // it so we don't leak them into the next object we draw
   gfx->Save();
   SetupGlobalTransform(gfx);
 
   CharacterIterator iter(this, true);
   iter.SetInitialMatrix(gfx);
 
   nsRefPtr<gfxPattern> strokePattern;
-  DrawMode drawMode = SetupCairoState(gfx, &strokePattern);
+  DrawMode drawMode = SetupCairoState(gfx, getter_AddRefs(strokePattern));
 
   if (drawMode) {
     DrawCharacters(&iter, gfx, drawMode, strokePattern);
   }
   
   gfx->Restore();
 
   return NS_OK;
@@ -879,17 +879,17 @@ 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 *aContext, nsRefPtr<gfxPattern> *aStrokePattern)
+nsSVGGlyphFrame::SetupCairoState(gfxContext *aContext, gfxPattern **aStrokePattern)
 {
   DrawMode toDraw = DrawMode(0);
   const nsStyleSVG* style = GetStyleSVG();
 
   if (HasStroke()) {
     gfxContextMatrixAutoSaveRestore matrixRestore(aContext);
     aContext->IdentityMatrix();
 
@@ -913,16 +913,17 @@ nsSVGGlyphFrame::SetupCairoState(gfxCont
                                           &nsStyleSVG::mStroke, &opacity,
                                           &color);
       strokePattern = 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));
     }
 
+    *aStrokePattern = nsnull;
     strokePattern.swap(*aStrokePattern);
   }
 
   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
@@ -264,12 +264,12 @@ protected:
   // The start index into the position and rotation data
   PRUint32 mStartIndex;
   bool mCompressWhitespace;
   bool mTrimLeadingWhitespace;
   bool mTrimTrailingWhitespace;
 
 private:
   DrawMode SetupCairoState(gfxContext *aContext,
-                           nsRefPtr<gfxPattern> *aStrokePattern);
+                           gfxPattern **aStrokePattern);
 };
 
 #endif