Bug 1291054 (Part 3) - Rename Decoder::GetSize() to Decoder::Size() to be consistent with the style guide. r=edwin

This commit is contained in:
Seth Fowler 2016-07-29 14:11:19 -07:00
parent 881c87ebec
commit 3cca5ff418
10 changed files with 16 additions and 17 deletions

View File

@ -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()));
}
}

View File

@ -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);
}

View File

@ -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)) {

View File

@ -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);
}

View File

@ -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();
}

View File

@ -70,8 +70,8 @@ nsIconDecoder::ReadHeader(const char* aData)
MOZ_ASSERT(!mImageData, "Already have a buffer allocated?");
Maybe<SurfacePipe> pipe =
SurfacePipeFactory::CreateSurfacePipe(this, 0, GetSize(), OutputSize(),
IntRect(IntPoint(), GetSize()),
SurfacePipeFactory::CreateSurfacePipe(this, 0, Size(), OutputSize(),
IntRect(IntPoint(), Size()),
SurfaceFormat::B8G8R8A8,
SurfacePipeFlags());
if (!pipe) {

View File

@ -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)) {

View File

@ -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<SurfacePipe> pipe =
SurfacePipeFactory::CreateSurfacePipe(this, mNumFrames, GetSize(),
SurfacePipeFactory::CreateSurfacePipe(this, mNumFrames, Size(),
OutputSize(), aFrameInfo.mFrameRect,
format, pipeFlags);

View File

@ -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);

View File

@ -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);