Backed out changeset 1bc7102718a9 (bug 1207830) for test failures in ImageDecoders.JPGDownscaleDuringDecode
This commit is contained in:
@@ -204,7 +204,6 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType,
|
|||||||
/* static */ already_AddRefed<Decoder>
|
/* static */ already_AddRefed<Decoder>
|
||||||
DecoderFactory::CreateAnonymousDecoder(DecoderType aType,
|
DecoderFactory::CreateAnonymousDecoder(DecoderType aType,
|
||||||
SourceBuffer* aSourceBuffer,
|
SourceBuffer* aSourceBuffer,
|
||||||
const Maybe<IntSize>& aTargetSize,
|
|
||||||
SurfaceFlags aSurfaceFlags)
|
SurfaceFlags aSurfaceFlags)
|
||||||
{
|
{
|
||||||
if (aType == DecoderType::UNKNOWN) {
|
if (aType == DecoderType::UNKNOWN) {
|
||||||
@@ -233,12 +232,6 @@ DecoderFactory::CreateAnonymousDecoder(DecoderType aType,
|
|||||||
decoder->SetDecoderFlags(decoderFlags);
|
decoder->SetDecoderFlags(decoderFlags);
|
||||||
decoder->SetSurfaceFlags(aSurfaceFlags);
|
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();
|
decoder->Init();
|
||||||
if (NS_FAILED(decoder->GetDecoderError())) {
|
if (NS_FAILED(decoder->GetDecoderError())) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -120,17 +120,12 @@ public:
|
|||||||
* @param aType Which type of decoder to create - JPEG, PNG, etc.
|
* @param aType Which type of decoder to create - JPEG, PNG, etc.
|
||||||
* @param aSourceBuffer The SourceBuffer which the decoder will read its data
|
* @param aSourceBuffer The SourceBuffer which the decoder will read its data
|
||||||
* from.
|
* 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
|
* @param aSurfaceFlags Flags specifying the type of output this decoder
|
||||||
* should produce.
|
* should produce.
|
||||||
*/
|
*/
|
||||||
static already_AddRefed<Decoder>
|
static already_AddRefed<Decoder>
|
||||||
CreateAnonymousDecoder(DecoderType aType,
|
CreateAnonymousDecoder(DecoderType aType,
|
||||||
SourceBuffer* aSourceBuffer,
|
SourceBuffer* aSourceBuffer,
|
||||||
const Maybe<gfx::IntSize>& aTargetSize,
|
|
||||||
SurfaceFlags aSurfaceFlags);
|
SurfaceFlags aSurfaceFlags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ ImageOps::DecodeToSurface(nsIInputStream* aInputStream,
|
|||||||
RefPtr<Decoder> decoder =
|
RefPtr<Decoder> decoder =
|
||||||
DecoderFactory::CreateAnonymousDecoder(decoderType,
|
DecoderFactory::CreateAnonymousDecoder(decoderType,
|
||||||
sourceBuffer,
|
sourceBuffer,
|
||||||
Nothing(),
|
|
||||||
ToSurfaceFlags(aFlags));
|
ToSurfaceFlags(aFlags));
|
||||||
if (!decoder) {
|
if (!decoder) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ CreateTrivialDecoder()
|
|||||||
DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif");
|
DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif");
|
||||||
RefPtr<SourceBuffer> sourceBuffer = new SourceBuffer();
|
RefPtr<SourceBuffer> sourceBuffer = new SourceBuffer();
|
||||||
RefPtr<Decoder> decoder =
|
RefPtr<Decoder> decoder =
|
||||||
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
|
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
|
||||||
DefaultSurfaceFlags());
|
DefaultSurfaceFlags());
|
||||||
return decoder.forget();
|
return decoder.forget();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ CheckDecoderSingleChunk(const ImageTestCase& aTestCase)
|
|||||||
DecoderType decoderType =
|
DecoderType decoderType =
|
||||||
DecoderFactory::GetDecoderType(aTestCase.mMimeType);
|
DecoderFactory::GetDecoderType(aTestCase.mMimeType);
|
||||||
RefPtr<Decoder> decoder =
|
RefPtr<Decoder> decoder =
|
||||||
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
|
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
|
||||||
DefaultSurfaceFlags());
|
DefaultSurfaceFlags());
|
||||||
ASSERT_TRUE(decoder != nullptr);
|
ASSERT_TRUE(decoder != nullptr);
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ CheckDecoderMultiChunk(const ImageTestCase& aTestCase)
|
|||||||
DecoderType decoderType =
|
DecoderType decoderType =
|
||||||
DecoderFactory::GetDecoderType(aTestCase.mMimeType);
|
DecoderFactory::GetDecoderType(aTestCase.mMimeType);
|
||||||
RefPtr<Decoder> decoder =
|
RefPtr<Decoder> decoder =
|
||||||
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
|
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
|
||||||
DefaultSurfaceFlags());
|
DefaultSurfaceFlags());
|
||||||
ASSERT_TRUE(decoder != nullptr);
|
ASSERT_TRUE(decoder != nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ CheckMetadata(const ImageTestCase& aTestCase,
|
|||||||
|
|
||||||
// Create a full decoder, so we can compare the result.
|
// Create a full decoder, so we can compare the result.
|
||||||
decoder =
|
decoder =
|
||||||
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer, Nothing(),
|
DecoderFactory::CreateAnonymousDecoder(decoderType, sourceBuffer,
|
||||||
DefaultSurfaceFlags());
|
DefaultSurfaceFlags());
|
||||||
ASSERT_TRUE(decoder != nullptr);
|
ASSERT_TRUE(decoder != nullptr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user