diff --git a/image/Decoder.cpp b/image/Decoder.cpp index 69bced776439..9bc5b7b3fcfc 100644 --- a/image/Decoder.cpp +++ b/image/Decoder.cpp @@ -453,7 +453,7 @@ Decoder::PostFrameStop(Opacity aFrameOpacity // here when the first frame is complete. if (!ShouldSendPartialInvalidations() && mFrameCount == 1) { mInvalidRect.UnionRect(mInvalidRect, - gfx::IntRect(gfx::IntPoint(0, 0), GetSize())); + IntRect(IntPoint(), Size())); } } diff --git a/image/Decoder.h b/image/Decoder.h index a38d7613c55b..38be32d0fa11 100644 --- a/image/Decoder.h +++ b/image/Decoder.h @@ -266,7 +266,7 @@ public: * * Illegal to call if HasSize() returns false. */ - gfx::IntSize GetSize() const + gfx::IntSize Size() const { MOZ_ASSERT(HasSize()); return mImageMetadata.GetSize(); @@ -282,7 +282,7 @@ public: gfx::IntSize OutputSize() const { return mDownscaler ? mDownscaler->TargetSize() - : GetSize(); + : Size(); } virtual Telemetry::ID SpeedHistogram(); @@ -411,8 +411,7 @@ protected: /// Helper method for decoders which only have 'basic' frame allocation needs. nsresult AllocateBasicFrame() { - nsIntSize size = GetSize(); - return AllocateFrame(0, size, nsIntRect(nsIntPoint(), size), + return AllocateFrame(0, Size(), gfx::IntRect(gfx::IntPoint(), Size()), gfx::SurfaceFormat::B8G8R8A8); } diff --git a/image/decoders/nsBMPDecoder.cpp b/image/decoders/nsBMPDecoder.cpp index e86c2ebe51fd..ec876c643660 100644 --- a/image/decoders/nsBMPDecoder.cpp +++ b/image/decoders/nsBMPDecoder.cpp @@ -686,7 +686,7 @@ nsBMPDecoder::ReadBitfields(const char* aData, size_t aLength) // BMPs store their rows in reverse order, so the downscaler needs to // reverse them again when writing its output. Unless the height is // negative! - rv = mDownscaler->BeginFrame(GetSize(), Nothing(), + rv = mDownscaler->BeginFrame(Size(), Nothing(), mImageData, mMayHaveTransparency, /* aFlipVertically = */ mH.mHeight >= 0); if (NS_FAILED(rv)) { diff --git a/image/decoders/nsGIFDecoder2.cpp b/image/decoders/nsGIFDecoder2.cpp index aaf4edd8e783..059d1e8102d8 100644 --- a/image/decoders/nsGIFDecoder2.cpp +++ b/image/decoders/nsGIFDecoder2.cpp @@ -199,7 +199,7 @@ nsGIFDecoder2::BeginImageFrame(const IntRect& aFrameRect, // The first frame is always decoded into an RGB surface. pipe = SurfacePipeFactory::CreateSurfacePipe(this, mGIFStruct.images_decoded, - GetSize(), OutputSize(), + Size(), OutputSize(), aFrameRect, format, pipeFlags); } else { // This is an animation frame (and not the first). To minimize the memory @@ -207,7 +207,7 @@ nsGIFDecoder2::BeginImageFrame(const IntRect& aFrameRect, MOZ_ASSERT(!mDownscaler); pipe = SurfacePipeFactory::CreatePalettedSurfacePipe(this, mGIFStruct.images_decoded, - GetSize(), aFrameRect, format, + Size(), aFrameRect, format, aDepth, pipeFlags); } diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp index fcf2abdfc141..e2e097123f92 100644 --- a/image/decoders/nsICODecoder.cpp +++ b/image/decoders/nsICODecoder.cpp @@ -582,7 +582,7 @@ nsICODecoder::FinishResource() // Make sure the actual size of the resource matches the size in the directory // entry. If not, we consider the image corrupt. if (mContainedDecoder->HasSize() && - mContainedDecoder->GetSize() != GetRealSize()) { + mContainedDecoder->Size() != GetRealSize()) { return Transition::TerminateFailure(); } diff --git a/image/decoders/nsIconDecoder.cpp b/image/decoders/nsIconDecoder.cpp index e2929c8314d7..3a223e9dc62d 100644 --- a/image/decoders/nsIconDecoder.cpp +++ b/image/decoders/nsIconDecoder.cpp @@ -70,8 +70,8 @@ nsIconDecoder::ReadHeader(const char* aData) MOZ_ASSERT(!mImageData, "Already have a buffer allocated?"); Maybe pipe = - SurfacePipeFactory::CreateSurfacePipe(this, 0, GetSize(), OutputSize(), - IntRect(IntPoint(), GetSize()), + SurfacePipeFactory::CreateSurfacePipe(this, 0, Size(), OutputSize(), + IntRect(IntPoint(), Size()), SurfaceFormat::B8G8R8A8, SurfacePipeFlags()); if (!pipe) { diff --git a/image/decoders/nsJPEGDecoder.cpp b/image/decoders/nsJPEGDecoder.cpp index afb6d769f4d4..fa3143a06c45 100644 --- a/image/decoders/nsJPEGDecoder.cpp +++ b/image/decoders/nsJPEGDecoder.cpp @@ -401,7 +401,7 @@ nsJPEGDecoder::ReadJPEGData(const char* aData, size_t aLength) MOZ_ASSERT(mImageData, "Should have a buffer now"); if (mDownscaler) { - nsresult rv = mDownscaler->BeginFrame(GetSize(), Nothing(), + nsresult rv = mDownscaler->BeginFrame(Size(), Nothing(), mImageData, /* aHasAlpha = */ false); if (NS_FAILED(rv)) { diff --git a/image/decoders/nsPNGDecoder.cpp b/image/decoders/nsPNGDecoder.cpp index b9ce414a60e3..e8fb964f6861 100644 --- a/image/decoders/nsPNGDecoder.cpp +++ b/image/decoders/nsPNGDecoder.cpp @@ -151,7 +151,7 @@ nsPNGDecoder::GetTransparencyType(SurfaceFormat aFormat, if (aFormat == SurfaceFormat::B8G8R8A8) { return TransparencyType::eAlpha; } - if (!IntRect(IntPoint(), GetSize()).IsEqualEdges(aFrameRect)) { + if (!IntRect(IntPoint(), Size()).IsEqualEdges(aFrameRect)) { MOZ_ASSERT(HasAnimation()); return TransparencyType::eFrameRect; } @@ -213,7 +213,7 @@ nsPNGDecoder::CreateFrame(const FrameInfo& aFrameInfo) } Maybe pipe = - SurfacePipeFactory::CreateSurfacePipe(this, mNumFrames, GetSize(), + SurfacePipeFactory::CreateSurfacePipe(this, mNumFrames, Size(), OutputSize(), aFrameInfo.mFrameRect, format, pipeFlags); diff --git a/image/test/gtest/TestDecoders.cpp b/image/test/gtest/TestDecoders.cpp index 94f4731347c9..e7fdfa76f2fe 100644 --- a/image/test/gtest/TestDecoders.cpp +++ b/image/test/gtest/TestDecoders.cpp @@ -55,7 +55,7 @@ CheckDecoderState(const ImageTestCase& aTestCase, Decoder* aDecoder) bool(progress & FLAG_IS_ANIMATED)); // The decoder should get the correct size. - IntSize size = aDecoder->GetSize(); + IntSize size = aDecoder->Size(); EXPECT_EQ(aTestCase.mSize.width, size.width); EXPECT_EQ(aTestCase.mSize.height, size.height); diff --git a/image/test/gtest/TestMetadata.cpp b/image/test/gtest/TestMetadata.cpp index 722a16cd3bda..b86911b82d10 100644 --- a/image/test/gtest/TestMetadata.cpp +++ b/image/test/gtest/TestMetadata.cpp @@ -88,7 +88,7 @@ CheckMetadata(const ImageTestCase& aTestCase, // Check that we got the expected metadata. EXPECT_TRUE(metadataProgress & FLAG_SIZE_AVAILABLE); - IntSize metadataSize = decoder->GetSize(); + IntSize metadataSize = decoder->Size(); EXPECT_EQ(aTestCase.mSize.width, metadataSize.width); EXPECT_EQ(aTestCase.mSize.height, metadataSize.height); @@ -122,7 +122,7 @@ CheckMetadata(const ImageTestCase& aTestCase, EXPECT_EQ(fullProgress, metadataProgress | fullProgress); // The full decoder and the metadata decoder should agree on the image's size. - IntSize fullSize = decoder->GetSize(); + IntSize fullSize = decoder->Size(); EXPECT_EQ(metadataSize.width, fullSize.width); EXPECT_EQ(metadataSize.height, fullSize.height);