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
parent a8597eb2e3
commit e33a216517
4 changed files with 7 additions and 3 deletions

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

View File

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