Bug 1062886 - Fix one color padded drawing path, r=seth

This commit is contained in:
Michael Wu 2014-09-10 16:04:28 -04:00
Родитель df253557b9
Коммит 6188a42531
4 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -446,13 +446,14 @@ imgFrame::SurfaceForDrawing(bool aDoPadding,
// Fill 'available' with whatever we've got
if (mSinglePixel) {
target->FillRect(ToRect(aRegion.Rect()), ColorPattern(mSinglePixelColor),
target->FillRect(ToRect(aRegion.Intersect(available).Rect()),
ColorPattern(mSinglePixelColor),
DrawOptions(1.0f, CompositionOp::OP_SOURCE));
} else {
SurfacePattern pattern(aSurface,
ExtendMode::REPEAT,
ToMatrix(aContext->CurrentMatrix()));
target->FillRect(ToRect(aRegion.Rect()), pattern);
target->FillRect(ToRect(aRegion.Intersect(available).Rect()), pattern);
}
RefPtr<SourceSurface> newsurf = target->Snapshot();
@ -503,7 +504,7 @@ bool imgFrame::Draw(gfxContext* aContext, const ImageRegion& aRegion,
mSize.height + aPadding.TopBottom());
RefPtr<SourceSurface> surf = GetSurface();
if (!surf) {
if (!surf && !mSinglePixel) {
return false;
}

Двоичные данные
image/test/reftest/gif/one-color-offset-ref.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 69 B

Двоичные данные
image/test/reftest/gif/one-color-offset.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 49 B

Просмотреть файл

@ -19,6 +19,9 @@ random == delaytest.html?transparent-animation.gif transparent-animation-finalfr
# test for bug 641198
skip-if(B2G) random-if(Android) == test_bug641198.html animation2a-finalframe.gif # bug 773482
# Bug 1062886: a gif with a single color and an offset
== one-color-offset.gif one-color-offset-ref.gif
# webcam-simulacrum.mgif is a hand-edited file containing red.gif and blue.gif,
# concatenated together with the relevant headers for
# multipart/x-mixed-replace. Specifically, with the headers in