@@ -75,15 +75,14 @@ OrientedImage::GetIntrinsicRatio(nsSize* aRatio)
7575 return rv;
7676}
7777
78- NS_IMETHODIMP
78+ NS_IMETHODIMP_ (already_AddRefed<gfxASurface>)
7979OrientedImage::GetFrame (uint32_t aWhichFrame,
80- uint32_t aFlags,
81- gfxASurface** _retval)
80+ uint32_t aFlags)
8281{
8382 nsresult rv;
8483
8584 if (mOrientation .IsIdentity ()) {
86- return InnerImage ()->GetFrame (aWhichFrame, aFlags, _retval );
85+ return InnerImage ()->GetFrame (aWhichFrame, aFlags);
8786 }
8887
8988 // Get the underlying dimensions.
@@ -95,7 +94,7 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
9594 rv = InnerImage ()->GetWidth (&width);
9695 rv = NS_FAILED(rv) ? rv : InnerImage ()->GetHeight (&height);
9796 }
98- NS_ENSURE_SUCCESS (rv, rv );
97+ NS_ENSURE_SUCCESS (rv, nullptr );
9998
10099 // Determine an appropriate format for the surface.
101100 gfx::SurfaceFormat surfaceFormat;
@@ -116,9 +115,9 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
116115 GetThebesSurfaceForDrawTarget (target);
117116
118117 // Create our drawable.
119- nsRefPtr<gfxASurface> innerSurface;
120- rv = InnerImage ()->GetFrame (aWhichFrame, aFlags, getter_AddRefs (innerSurface) );
121- NS_ENSURE_SUCCESS (rv, rv );
118+ nsRefPtr<gfxASurface> innerSurface =
119+ InnerImage ()->GetFrame (aWhichFrame, aFlags);
120+ NS_ENSURE_TRUE (innerSurface, nullptr );
122121 nsRefPtr<gfxDrawable> drawable =
123122 new gfxSurfaceDrawable (innerSurface, gfxIntSize (width, height));
124123
@@ -129,8 +128,7 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
129128 imageRect, imageRect, imageRect, imageRect,
130129 imageFormat, GraphicsFilter::FILTER_FAST);
131130
132- surface.forget (_retval);
133- return NS_OK;
131+ return surface.forget ();
134132}
135133
136134NS_IMETHODIMP
0 commit comments