Backed out changeset 1bc7102718a9 (bug 1207830) for test failures in ImageDecoders.JPGDownscaleDuringDecode

This commit is contained in:
Carsten "Tomcat" Book
2016-05-27 09:05:25 +02:00
parent 6f0882c95b
commit 1a2dcc1022
6 changed files with 4 additions and 17 deletions

View File

@@ -204,7 +204,6 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType,
/* static */ already_AddRefed<Decoder>
DecoderFactory::CreateAnonymousDecoder(DecoderType aType,
SourceBuffer* aSourceBuffer,
const Maybe<IntSize>& aTargetSize,
SurfaceFlags aSurfaceFlags)
{
if (aType == DecoderType::UNKNOWN) {
@@ -233,12 +232,6 @@ DecoderFactory::CreateAnonymousDecoder(DecoderType aType,
decoder->SetDecoderFlags(decoderFlags);
decoder->SetSurfaceFlags(aSurfaceFlags);
// Set a target size for downscale-during-decode if applicable.
if (aTargetSize) {
DebugOnly<nsresult> rv = decoder->SetTargetSize(*aTargetSize);
MOZ_ASSERT(NS_SUCCEEDED(rv), "Bad downscale-during-decode target size?");
}
decoder->Init();
if (NS_FAILED(decoder->GetDecoderError())) {
return nullptr;

View File

@@ -120,17 +120,12 @@ public:
* @param aType Which type of decoder to create - JPEG, PNG, etc.
* @param aSourceBuffer The SourceBuffer which the decoder will read its data
* from.
* @param aTargetSize If not Nothing(), the target size which the image should
* be scaled to during decoding. It's an error to specify
* a target size for a decoder type which doesn't support
* downscale-during-decode.
* @param aSurfaceFlags Flags specifying the type of output this decoder
* should produce.
*/
static already_AddRefed<Decoder>
CreateAnonymousDecoder(DecoderType aType,
SourceBuffer* aSourceBuffer,
const Maybe<gfx::IntSize>& aTargetSize,
SurfaceFlags aSurfaceFlags);
/**

View File

@@ -120,7 +120,6 @@ ImageOps::DecodeToSurface(nsIInputStream* aInputStream,
RefPtr<Decoder> decoder =
DecoderFactory::CreateAnonymousDecoder(decoderType,
sourceBuffer,
Nothing(),
ToSurfaceFlags(aFlags));
if (!decoder) {
return nullptr;

View File

@@ -161,7 +161,7 @@ CreateTrivialDecoder()
DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif");
RefPtr<SourceBuffer> sourceBuffer = new SourceBuffer();
RefPtr<Decoder> decoder =
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
DefaultSurfaceFlags());
return decoder.forget();
}

View File

@@ -104,7 +104,7 @@ CheckDecoderSingleChunk(const ImageTestCase& aTestCase)
DecoderType decoderType =
DecoderFactory::GetDecoderType(aTestCase.mMimeType);
RefPtr<Decoder> decoder =
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
DefaultSurfaceFlags());
ASSERT_TRUE(decoder != nullptr);
@@ -141,7 +141,7 @@ CheckDecoderMultiChunk(const ImageTestCase& aTestCase)
DecoderType decoderType =
DecoderFactory::GetDecoderType(aTestCase.mMimeType);
RefPtr<Decoder> decoder =
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
DefaultSurfaceFlags());
ASSERT_TRUE(decoder != nullptr);

View File

@@ -110,7 +110,7 @@ CheckMetadata(const ImageTestCase& aTestCase,
// Create a full decoder, so we can compare the result.
decoder =
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
DefaultSurfaceFlags());
ASSERT_TRUE(decoder != nullptr);