Bug 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin
authorSeth Fowler <mark.seth.fowler@gmail.com>
Thu, 18 Aug 2016 12:43:16 -0700
changeset 310018 e7caba6197ba3500be336d88ca2571aa6c0b8192
parent 310017 0f9b465ebb5fab7f1dd2d7eb32e172292a618b21
child 310019 d7203b2bd9c950469de256b94f78547a32f91030
push id80755
push userseth.bugzilla@blackhail.net
push dateThu, 18 Aug 2016 20:04:04 +0000
treeherdermozilla-inbound@d7203b2bd9c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1296147
milestone51.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 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin
image/ISurfaceProvider.h
image/ImageOps.cpp
image/RasterImage.cpp
image/VectorImage.cpp
image/imgFrame.cpp
image/imgFrame.h
image/test/gtest/Common.cpp
image/test/gtest/TestADAM7InterpolatingFilter.cpp
image/test/gtest/TestDecoders.cpp
image/test/gtest/TestDeinterlacingFilter.cpp
image/test/gtest/TestDownscalingFilter.cpp
image/test/gtest/TestSurfaceSink.cpp
--- a/image/ISurfaceProvider.h
+++ b/image/ISurfaceProvider.h
@@ -84,17 +84,17 @@ private:
   AvailabilityState mAvailability;
 };
 
 
 /**
  * A reference to a surface (stored in an imgFrame) that holds the surface in
  * memory, guaranteeing that it can be drawn. If you have a DrawableSurface
  * |surf| and |if (surf)| returns true, then calls to |surf->Draw()| and
- * |surf->GetSurface()| are guaranteed to succeed.
+ * |surf->GetSourceSurface()| are guaranteed to succeed.
  *
  * Note that the surface may be computed lazily, so a DrawableSurface should not
  * be dereferenced (i.e., operator->() should not be called) until you're
  * sure that you want to draw it.
  */
 class MOZ_STACK_CLASS DrawableSurface final
 {
 public:
--- a/image/ImageOps.cpp
+++ b/image/ImageOps.cpp
@@ -133,17 +133,17 @@ ImageOps::DecodeToSurface(nsIInputStream
   }
 
   // Pull out the surface.
   RawAccessFrameRef frame = decoder->GetCurrentFrameRef();
   if (!frame) {
     return nullptr;
   }
 
-  RefPtr<SourceSurface> surface = frame->GetSurface();
+  RefPtr<SourceSurface> surface = frame->GetSourceSurface();
   if (!surface) {
     return nullptr;
   }
 
   return surface.forget();
 }
 
 } // namespace image
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -509,17 +509,17 @@ RasterImage::GetFrameInternal(const IntS
   // FLAG_SYNC_DECODE
   DrawableSurface surface =
     LookupFrame(GetRequestedFrameIndex(aWhichFrame), aSize, aFlags);
   if (!surface) {
     // The OS threw this frame away and we couldn't redecode it.
     return MakePair(DrawResult::TEMPORARY_ERROR, RefPtr<SourceSurface>());
   }
 
-  RefPtr<SourceSurface> sourceSurface = surface->GetSurface();
+  RefPtr<SourceSurface> sourceSurface = surface->GetSourceSurface();
 
   if (!surface->IsFinished()) {
     return MakePair(DrawResult::INCOMPLETE, Move(sourceSurface));
   }
 
   return MakePair(DrawResult::SUCCESS, Move(sourceSurface));
 }
 
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -867,17 +867,17 @@ VectorImage::Draw(gfxContext* aContext,
   LookupResult result =
     SurfaceCache::Lookup(ImageKey(this),
                          VectorSurfaceKey(params.size,
                                           params.svgContext,
                                           params.animationTime));
 
   // Draw.
   if (result) {
-    RefPtr<SourceSurface> sourceSurface = result.Surface()->GetSurface();
+    RefPtr<SourceSurface> sourceSurface = result.Surface()->GetSourceSurface();
     if (sourceSurface) {
       RefPtr<gfxDrawable> svgDrawable =
         new gfxSurfaceDrawable(sourceSurface, result.Surface()->GetSize());
       Show(svgDrawable, params);
       return DrawResult::SUCCESS;
     }
 
     // We lost our surface due to some catastrophic event.
@@ -934,17 +934,17 @@ VectorImage::CreateSurfaceAndShow(const 
   // up way too big. Generally it also wouldn't fit in the cache, but the prefs
   // could be set such that the cache isn't the limiting factor.
   if (NS_FAILED(rv)) {
     return Show(svgDrawable, aParams);
   }
 
   // Take a strong reference to the frame's surface and make sure it hasn't
   // already been purged by the operating system.
-  RefPtr<SourceSurface> surface = frame->GetSurface();
+  RefPtr<SourceSurface> surface = frame->GetSourceSurface();
   if (!surface) {
     return Show(svgDrawable, aParams);
   }
 
   // Attempt to cache the frame.
   NotNull<RefPtr<ISurfaceProvider>> provider =
     WrapNotNull(new SimpleSurfaceProvider(frame));
   SurfaceCache::Insert(provider, ImageKey(this),
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -545,17 +545,17 @@ bool imgFrame::Draw(gfxContext* aContext
     MOZ_ASSERT_UNREACHABLE("Directly drawing a paletted image!");
     return false;
   }
 
   MonitorAutoLock lock(mMonitor);
 
   bool doPartialDecode = !AreAllPixelsWritten();
 
-  RefPtr<SourceSurface> surf = GetSurfaceInternal();
+  RefPtr<SourceSurface> surf = GetSourceSurfaceInternal();
   if (!surf) {
     return false;
   }
 
   gfxRect imageRect(0, 0, mImageSize.width, mImageSize.height);
   bool doTile = !imageRect.Contains(aRegion.Rect()) &&
                 !(aImageFlags & imgIContainer::FLAG_CLAMP);
 
@@ -802,24 +802,24 @@ void
 imgFrame::SetOptimizable()
 {
   AssertImageDataLocked();
   MonitorAutoLock lock(mMonitor);
   mOptimizable = true;
 }
 
 already_AddRefed<SourceSurface>
-imgFrame::GetSurface()
+imgFrame::GetSourceSurface()
 {
   MonitorAutoLock lock(mMonitor);
-  return GetSurfaceInternal();
+  return GetSourceSurfaceInternal();
 }
 
 already_AddRefed<SourceSurface>
-imgFrame::GetSurfaceInternal()
+imgFrame::GetSourceSurfaceInternal()
 {
   mMonitor.AssertCurrentThreadOwns();
 
   if (mOptSurface) {
     if (mOptSurface->IsValid()) {
       RefPtr<SourceSurface> surf(mOptSurface);
       return surf.forget();
     } else {
--- a/image/imgFrame.h
+++ b/image/imgFrame.h
@@ -331,17 +331,17 @@ public:
 
   AnimationData GetAnimationData() const;
 
   bool GetCompositingFailed() const;
   void SetCompositingFailed(bool val);
 
   void SetOptimizable();
 
-  already_AddRefed<SourceSurface> GetSurface();
+  already_AddRefed<SourceSurface> GetSourceSurface();
 
   void AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf, size_t& aHeapSizeOut,
                               size_t& aNonHeapSizeOut) const;
 
 private: // methods
 
   ~imgFrame();
 
@@ -352,17 +352,17 @@ private: // methods
 
   void AssertImageDataLocked() const;
 
   bool AreAllPixelsWritten() const;
   nsresult ImageUpdatedInternal(const nsIntRect& aUpdateRect);
   void GetImageDataInternal(uint8_t** aData, uint32_t* length) const;
   uint32_t GetImageBytesPerRow() const;
   uint32_t GetImageDataLength() const;
-  already_AddRefed<SourceSurface> GetSurfaceInternal();
+  already_AddRefed<SourceSurface> GetSourceSurfaceInternal();
 
   uint32_t PaletteDataLength() const
   {
     return mPaletteDepth ? (size_t(1) << mPaletteDepth) * sizeof(uint32_t)
                          : 0;
   }
 
   struct SurfaceWithFormat {
@@ -438,17 +438,17 @@ private: // data
   //////////////////////////////////////////////////////////////////////////////
 
   bool mCompositingFailed;
 };
 
 /**
  * A reference to an imgFrame that holds the imgFrame's surface in memory,
  * allowing drawing. If you have a DrawableFrameRef |ref| and |if (ref)| returns
- * true, then calls to Draw() and GetSurface() are guaranteed to succeed.
+ * true, then calls to Draw() and GetSourceSurface() are guaranteed to succeed.
  */
 class DrawableFrameRef final
 {
 public:
   DrawableFrameRef() { }
 
   explicit DrawableFrameRef(imgFrame* aFrame)
     : mFrame(aFrame)
--- a/image/test/gtest/Common.cpp
+++ b/image/test/gtest/Common.cpp
@@ -283,17 +283,17 @@ AssertCorrectPipelineFinalState(SurfaceF
 }
 
 void
 CheckGeneratedImage(Decoder* aDecoder,
                     const IntRect& aRect,
                     uint8_t aFuzz /* = 0 */)
 {
   RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-  RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+  RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
   const IntSize surfaceSize = surface->GetSize();
 
   // This diagram shows how the surface is divided into regions that the code
   // below tests for the correct content. The output rect is the bounds of the
   // region labeled 'C'.
   //
   // +---------------------------+
   // |             A             |
--- a/image/test/gtest/TestADAM7InterpolatingFilter.cpp
+++ b/image/test/gtest/TestADAM7InterpolatingFilter.cpp
@@ -260,17 +260,17 @@ WriteUninterpolatedPixels(SurfaceFilter*
 
 bool
 CheckHorizontallyInterpolatedImage(Decoder* aDecoder,
                                    const IntSize& aSize,
                                    uint8_t aPass,
                                    const vector<BGRAColor>& aColors)
 {
   RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-  RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+  RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
   for (int32_t row = 0; row < aSize.height; ++row) {
     if (!IsImportantRow(row, aPass)) {
       continue;  // Don't check rows which aren't important on this pass.
     }
 
     // Compute the expected pixels, *with* interpolation to match what the
     // filter should have done.
@@ -397,17 +397,17 @@ CheckVerticallyInterpolatedImage(Decoder
     // solid-colored rows.
     vector<BGRAColor> expectedPixels(aSize.width);
     generate(expectedPixels.begin(), expectedPixels.end(), [&]{
       return interpolatedColor;
     });
 
     // Check that the pixels match.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
     if (!RowHasPixels(surface, row, expectedPixels)) {
       return false;
     }
   }
 
   return true;
 }
 
--- a/image/test/gtest/TestDecoders.cpp
+++ b/image/test/gtest/TestDecoders.cpp
@@ -57,17 +57,17 @@ CheckDecoderState(const ImageTestCase& a
   // The decoder should get the correct size.
   IntSize size = aDecoder->Size();
   EXPECT_EQ(aTestCase.mSize.width, size.width);
   EXPECT_EQ(aTestCase.mSize.height, size.height);
 
   // Get the current frame, which is always the first frame of the image
   // because CreateAnonymousDecoder() forces a first-frame-only decode.
   RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-  RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+  RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
   // Verify that the resulting surfaces matches our expectations.
   EXPECT_EQ(SurfaceType::DATA, surface->GetType());
   EXPECT_TRUE(surface->GetFormat() == SurfaceFormat::B8G8R8X8 ||
               surface->GetFormat() == SurfaceFormat::B8G8R8A8);
   EXPECT_EQ(aTestCase.mOutputSize, surface->GetSize());
 
   return surface.forget();
--- a/image/test/gtest/TestDeinterlacingFilter.cpp
+++ b/image/test/gtest/TestDeinterlacingFilter.cpp
@@ -224,17 +224,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
 
     AssertCorrectPipelineFinalState(aFilter,
                                     IntRect(0, 0, 51, 52),
                                     IntRect(0, 0, 51, 52));
 
     // Check that the generated image is correct. As mentioned above, we expect
     // even rows to be green and odd rows to be red.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     for (uint32_t row = 0; row < 52; ++row) {
       EXPECT_TRUE(RowsAreSolidColor(surface, row, 1,
                                     row % 2 == 0 ? BGRAColor::Green()
                                                  : BGRAColor::Red()));
     }
   });
 }
@@ -298,17 +298,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
 
     AssertCorrectPipelineFinalState(aFilter,
                                     IntRect(0, 0, 20, 20),
                                     IntRect(0, 0, 20, 20));
 
     // Check that the generated image is correct. As mentioned above, we expect
     // even rows to be green and odd rows to be red.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     for (uint32_t row = 0; row < 20; ++row) {
       EXPECT_TRUE(RowsAreSolidColor(surface, row, 1,
                                     row % 2 == 0 ? BGRAColor::Green()
                                                  : BGRAColor::Red()));
     }
   });
 }
@@ -359,17 +359,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
 
     AssertCorrectPipelineFinalState(aFilter,
                                     IntRect(0, 0, 7, 7),
                                     IntRect(0, 0, 7, 7));
 
     // Check that the generated image is correct. As mentioned above, we expect
     // two green rows, followed by two red rows, then two green rows, etc.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     for (uint32_t row = 0; row < 7; ++row) {
       BGRAColor color = row == 0 || row == 1 || row == 4 || row == 5
                       ? BGRAColor::Green()
                       : BGRAColor::Red();
       EXPECT_TRUE(RowsAreSolidColor(surface, row, 1, color));
     }
   });
@@ -413,17 +413,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
 
     AssertCorrectPipelineFinalState(aFilter,
                                     IntRect(0, 0, 3, 3),
                                     IntRect(0, 0, 3, 3));
 
     // Check that the generated image is correct. As mentioned above, we expect
     // green, red, green in that order.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     for (uint32_t row = 0; row < 3; ++row) {
       EXPECT_TRUE(RowsAreSolidColor(surface, row, 1,
                                     row == 0 || row == 2 ? BGRAColor::Green()
                                                          : BGRAColor::Red()));
     }
   });
 }
@@ -443,17 +443,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
 
     AssertCorrectPipelineFinalState(aFilter,
                                     IntRect(0, 0, 1, 1),
                                     IntRect(0, 0, 1, 1));
 
     // Check that the generated image is correct. As mentioned above, we expect
     // a single red row.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     EXPECT_TRUE(RowsAreSolidColor(surface, 0, 1, BGRAColor::Red()));
   });
 }
 
 void
 WriteRowAndCheckInterlacerOutput(Decoder* aDecoder,
                                  SurfaceFilter* aFilter,
@@ -484,17 +484,17 @@ WriteRowAndCheckInterlacerOutput(Decoder
 
   // Check that the portion of the image generated so far is correct. The rows
   // from aFirstHaeberliRow to aLastHaeberliRow should be filled with aColor.
   // Note that this is not the same as the set of rows in aInvalidRect, because
   // after writing a row the deinterlacer seeks to the next row to write, which
   // may involve copying previously-written rows in the buffer to the output
   // even though they don't change in this pass.
   RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-  RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+  RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
   for (uint32_t row = aFirstHaeberliRow; row <= aLastHaeberliRow; ++row) {
     EXPECT_TRUE(RowsAreSolidColor(surface, row, 1, aColor));
   }
 }
 
 TEST_F(ImageDeinterlacingFilter, WritePixelsIntermediateOutput7_7)
 {
@@ -561,17 +561,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
     // Assert that we're in the expected final state.
     EXPECT_TRUE(aFilter->IsSurfaceFinished());
     Maybe<SurfaceInvalidRect> invalidRect = aFilter->TakeInvalidRect();
     EXPECT_TRUE(invalidRect.isNothing());
 
     // Check that the generated image is correct. As mentioned above, we expect
     // two green rows, followed by two red rows, then two green rows, etc.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     for (uint32_t row = 0; row < 7; ++row) {
       BGRAColor color = row == 0 || row == 1 || row == 4 || row == 5
                       ? BGRAColor::Green()
                       : BGRAColor::Red();
       EXPECT_TRUE(RowsAreSolidColor(surface, row, 1, color));
     }
   });
@@ -642,17 +642,17 @@ TEST_F(ImageDeinterlacingFilter, WritePi
     // Assert that we're in the expected final state.
     EXPECT_TRUE(aFilter->IsSurfaceFinished());
     Maybe<SurfaceInvalidRect> invalidRect = aFilter->TakeInvalidRect();
     EXPECT_TRUE(invalidRect.isNothing());
 
     // Check that the generated image is correct. As mentioned above, we expect
     // two green rows, followed by two red rows, then two green rows, etc.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
     for (uint32_t row = 0; row < 7; ++row) {
       BGRAColor color = row == 0 || row == 1 || row == 4 || row == 5
                       ? BGRAColor::Green()
                       : BGRAColor::Red();
       EXPECT_TRUE(RowsAreSolidColor(surface, row, 1, color));
     }
   });
--- a/image/test/gtest/TestDownscalingFilter.cpp
+++ b/image/test/gtest/TestDownscalingFilter.cpp
@@ -167,17 +167,17 @@ TEST(ImageDownscalingFilter, WritePixels
                                     IntRect(0, 0, 100, 100),
                                     IntRect(0, 0, 20, 20));
 
     // Check that the generated image is correct. Note that we skip rows near
     // the transitions between colors, since the downscaler does not produce a
     // sharp boundary at these points. Even some of the rows we test need a
     // small amount of fuzz; this is just the nature of Lanczos downscaling.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
     EXPECT_TRUE(RowsAreSolidColor(surface, 0, 4, BGRAColor::Green(), /* aFuzz = */ 2));
     EXPECT_TRUE(RowsAreSolidColor(surface, 6, 3, BGRAColor::Red(), /* aFuzz = */ 3));
     EXPECT_TRUE(RowsAreSolidColor(surface, 11, 3, BGRAColor::Green(), /* aFuzz = */ 3));
     EXPECT_TRUE(RowsAreSolidColor(surface, 16, 4, BGRAColor::Red(), /* aFuzz = */ 3));
   });
 }
 
 TEST(ImageDownscalingFilter, WritePixelsOutput100_100to10_20)
@@ -201,17 +201,17 @@ TEST(ImageDownscalingFilter, WritePixels
                                     IntRect(0, 0, 100, 100),
                                     IntRect(0, 0, 10, 20));
 
     // Check that the generated image is correct. Note that we skip rows near
     // the transitions between colors, since the downscaler does not produce a
     // sharp boundary at these points. Even some of the rows we test need a
     // small amount of fuzz; this is just the nature of Lanczos downscaling.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
     EXPECT_TRUE(RowsAreSolidColor(surface, 0, 4, BGRAColor::Green(), /* aFuzz = */ 2));
     EXPECT_TRUE(RowsAreSolidColor(surface, 6, 3, BGRAColor::Red(), /* aFuzz = */ 3));
     EXPECT_TRUE(RowsAreSolidColor(surface, 11, 3, BGRAColor::Green(), /* aFuzz = */ 3));
     EXPECT_TRUE(RowsAreSolidColor(surface, 16, 4, BGRAColor::Red(), /* aFuzz = */ 3));
   });
 }
 
 TEST(ImageDownscalingFilter, ConfiguringPalettedDownscaleFails)
--- a/image/test/gtest/TestSurfaceSink.cpp
+++ b/image/test/gtest/TestSurfaceSink.cpp
@@ -225,17 +225,17 @@ TEST(ImageSurfaceSink, SurfaceSinkWriteP
       return AsVariant(BGRAColor::Red().AsPixel());
     });
     EXPECT_EQ(WriteState::FINISHED, result);
     EXPECT_EQ(0u, count);
     EXPECT_TRUE(aSink->IsSurfaceFinished());
 
     // Check that the generated image is correct.
     RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-    RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+    RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
     EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Transparent()));
   });
 }
 
 TEST(ImageSurfaceSink, SurfaceSinkWritePixelsEarlyExit)
 {
   auto checkEarlyExit =
     [](Decoder* aDecoder, SurfaceSink* aSink, WriteState aState) {
@@ -627,17 +627,17 @@ TEST(ImageSurfaceSink, SurfaceSinkWriteE
           return aSink->WriteBuffer(buffer);
         } else {
           return aSink->WriteEmptyRow();
         }
       };
 
       auto checkFunc = [&]{
         RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-        RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+        RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
 
         EXPECT_TRUE(RowsAreSolidColor(surface, 0, 20, BGRAColor::Green()));
         EXPECT_TRUE(RowsAreSolidColor(surface, 20, 60, BGRAColor::Transparent()));
         EXPECT_TRUE(RowsAreSolidColor(surface, 80, 20, BGRAColor::Green()));
       };
 
       DoCheckIterativeWrite(aSink, writeFunc, checkFunc);
     }
@@ -681,26 +681,26 @@ TEST(ImageSurfaceSink, SurfaceSinkProgre
       EXPECT_EQ(100u * 100u, count);
 
       AssertCorrectPipelineFinalState(aSink,
                                       IntRect(0, 0, 100, 100),
                                       IntRect(0, 0, 100, 100));
 
       // Check that the generated image is correct.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Red()));
     }
 
     {
       ResetForNextPass(aSink);
 
       // Check that the generated image is still the first pass image.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Red()));
     }
 
     {
       // Fill the image with a second pass of green.
       uint32_t count = 0;
       auto result = aSink->WritePixels<uint32_t>([&]() {
         ++count;
@@ -710,17 +710,17 @@ TEST(ImageSurfaceSink, SurfaceSinkProgre
       EXPECT_EQ(100u * 100u, count);
 
       AssertCorrectPipelineFinalState(aSink,
                                       IntRect(0, 0, 100, 100),
                                       IntRect(0, 0, 100, 100));
 
       // Check that the generated image is correct.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Green()));
     }
   });
 }
 
 TEST(ImageSurfaceSink, SurfaceSinkInvalidRect)
 {
   WithSurfaceSink<Orient::NORMAL>([](Decoder* aDecoder, SurfaceSink* aSink) {
@@ -835,17 +835,17 @@ TEST(ImageSurfaceSink, SurfaceSinkInvali
       // Assert that we have the right invalid rect.
       Maybe<SurfaceInvalidRect> invalidRect = aSink->TakeInvalidRect();
       EXPECT_TRUE(invalidRect.isSome());
       EXPECT_EQ(IntRect(0, 10, 100, 90), invalidRect->mInputSpaceRect);
       EXPECT_EQ(IntRect(0, 10, 100, 90), invalidRect->mOutputSpaceRect);
 
       // Check that the generated image is correct.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Green()));
     }
   });
 }
 
 TEST(ImageSurfaceSink, SurfaceSinkFlipVertically)
 {
   WithSurfaceSink<Orient::FLIP_VERTICALLY>([](Decoder* aDecoder,
@@ -861,26 +861,26 @@ TEST(ImageSurfaceSink, SurfaceSinkFlipVe
       EXPECT_EQ(100u * 100u, count);
 
       AssertCorrectPipelineFinalState(aSink,
                                       IntRect(0, 0, 100, 100),
                                       IntRect(0, 0, 100, 100));
 
       // Check that the generated image is correct.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Red()));
     }
 
     {
       ResetForNextPass(aSink);
 
       // Check that the generated image is still the first pass image.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Red()));
     }
 
     {
       // Fill 25 rows of the image with green and make sure everything is OK.
       uint32_t count = 0;
       auto result = aSink->WritePixels<uint32_t>([&]() -> NextPixel<uint32_t> {
         if (count == 25 * 100) {
@@ -897,17 +897,17 @@ TEST(ImageSurfaceSink, SurfaceSinkFlipVe
       // *bottom* (since we're flipping vertically) 25 rows of the image.
       Maybe<SurfaceInvalidRect> invalidRect = aSink->TakeInvalidRect();
       EXPECT_TRUE(invalidRect.isSome());
       EXPECT_EQ(IntRect(0, 75, 100, 25), invalidRect->mInputSpaceRect);
       EXPECT_EQ(IntRect(0, 75, 100, 25), invalidRect->mOutputSpaceRect);
 
       // Check that the generated image is correct.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(RowsAreSolidColor(surface, 0, 75, BGRAColor::Red()));
       EXPECT_TRUE(RowsAreSolidColor(surface, 75, 25, BGRAColor::Green()));
     }
 
     {
       // Fill the rest of the image with a second pass of green.
       uint32_t count = 0;
       auto result = aSink->WritePixels<uint32_t>([&]() {
@@ -918,17 +918,17 @@ TEST(ImageSurfaceSink, SurfaceSinkFlipVe
       EXPECT_EQ(75u * 100u, count);
 
       AssertCorrectPipelineFinalState(aSink,
                                       IntRect(0, 0, 100, 75),
                                       IntRect(0, 0, 100, 75));
 
       // Check that the generated image is correct.
       RawAccessFrameRef currentFrame = aDecoder->GetCurrentFrameRef();
-      RefPtr<SourceSurface> surface = currentFrame->GetSurface();
+      RefPtr<SourceSurface> surface = currentFrame->GetSourceSurface();
       EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Green()));
     }
   });
 }
 
 TEST(ImageSurfaceSink, PalettedSurfaceSinkInitialization)
 {
   WithPalettedSurfaceSink(IntRect(0, 0, 100, 100),