Bug 697475: deCOMtaminate nsSVGPatternFrame::GetPatternFirstChild. r=longsonr
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 27 Oct 2011 15:57:10 -0700
changeset 79338 b317557f9b78a3b74765dfb1927a9efcac758193
parent 79337 9fa6410c1a3ac36d8767611080ada503415c22a3
child 79339 6181f480fcea2b50cdbe7f916cce5f552e79da4d
push id21384
push userbmo@edmorley.co.uk
push dateFri, 28 Oct 2011 09:54:44 +0000
treeherdermozilla-central@6ec5b28142d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs697475
milestone10.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 697475: deCOMtaminate nsSVGPatternFrame::GetPatternFirstChild. r=longsonr
layout/svg/base/src/nsSVGPatternFrame.cpp
layout/svg/base/src/nsSVGPatternFrame.h
--- a/layout/svg/base/src/nsSVGPatternFrame.cpp
+++ b/layout/svg/base/src/nsSVGPatternFrame.cpp
@@ -191,18 +191,18 @@ nsSVGPatternFrame::PaintPattern(gfxASurf
    *    Calculate the content transformation matrix
    *    Get our children (we may need to get them from another Pattern)
    *    Call SVGPaint on all of our children
    *    Return
    */
   *surface = nsnull;
 
   // Get the first child of the pattern data we will render
-  nsIFrame *firstKid;
-  if (NS_FAILED(GetPatternFirstChild(&firstKid)))
+  nsIFrame* firstKid = GetPatternFirstChild();
+  if (!firstKid)
     return NS_ERROR_FAILURE; // Either no kids or a bad reference
 
   /*
    * Get the content geometry information.  This is a little tricky --
    * our parent is probably a <defs>, but we are rendering in the context
    * of some geometry source.  Our content geometry information needs to
    * come from our rendering parent as opposed to our content parent.  We
    * get that information from aSource, which is passed to us from the
@@ -346,32 +346,32 @@ nsSVGPatternFrame::PaintPattern(gfxASurf
   tmpSurface.forget(surface);
   return NS_OK;
 }
 
 /* Will probably need something like this... */
 // How do we handle the insertion of a new frame?
 // We really don't want to rerender this every time,
 // do we?
-NS_IMETHODIMP
-nsSVGPatternFrame::GetPatternFirstChild(nsIFrame **kid)
+nsIFrame*
+nsSVGPatternFrame::GetPatternFirstChild()
 {
   // Do we have any children ourselves?
-  *kid = mFrames.FirstChild();
-  if (*kid)
-    return NS_OK;
+  nsIFrame* kid = mFrames.FirstChild();
+  if (kid)
+    return kid;
 
   // No, see if we chain to someone who does
   AutoPatternReferencer patternRef(this);
 
-  nsSVGPatternFrame *next = GetReferencedPatternIfNotInUse();
+  nsSVGPatternFrame* next = GetReferencedPatternIfNotInUse();
   if (!next)
-    return NS_ERROR_FAILURE;
+    return nsnull;
 
-  return next->GetPatternFirstChild(kid);
+  return next->GetPatternFirstChild();
 }
 
 PRUint16
 nsSVGPatternFrame::GetEnumValue(PRUint32 aIndex, nsIContent *aDefault)
 {
   nsSVGEnum& thisEnum =
     static_cast<nsSVGPatternElement *>(mContent)->mEnumAttributes[aIndex];
 
--- a/layout/svg/base/src/nsSVGPatternFrame.h
+++ b/layout/svg/base/src/nsSVGPatternFrame.h
@@ -138,17 +138,17 @@ protected:
     return GetLengthValue(aIndex, mContent);
   }
 
   nsresult PaintPattern(gfxASurface **surface,
                         gfxMatrix *patternMatrix,
                         nsIFrame *aSource,
                         float aGraphicOpacity,
                         const gfxRect *aOverrideBounds);
-  NS_IMETHOD GetPatternFirstChild(nsIFrame **kid);
+  nsIFrame*  GetPatternFirstChild();
   gfxRect    GetPatternRect(const gfxRect &bbox,
                             const gfxMatrix &callerCTM,
                             nsIFrame *aTarget);
   gfxMatrix  GetPatternMatrix(const gfxMatrix &patternTransform,
                               const gfxRect &bbox,
                               const gfxRect &callerBBox,
                               const gfxMatrix &callerCTM);
   gfxMatrix  ConstructCTM(const gfxRect &callerBBox,