Bug 1068230 - Don't use the gfxContext transform in intermediate surface. r=seth, a=sledru
--- a/image/src/imgFrame.cpp
+++ b/image/src/imgFrame.cpp
@@ -341,26 +341,19 @@ imgFrame::SurfaceForDrawing(bool
if (!target)
return SurfaceWithFormat();
// Fill 'available' with whatever we've got
if (mSinglePixel) {
target->FillRect(ToRect(available), ColorPattern(mSinglePixelColor),
DrawOptions(1.0f, CompositionOp::OP_SOURCE));
} else {
- gfxMatrix imageSpaceToUserSpace = aUserSpaceToImageSpace;
- imageSpaceToUserSpace.Invert();
SurfacePattern pattern(aSurface,
ExtendMode::REPEAT,
- Matrix(imageSpaceToUserSpace._11,
- imageSpaceToUserSpace._21,
- imageSpaceToUserSpace._12,
- imageSpaceToUserSpace._22,
- imageSpaceToUserSpace._31,
- imageSpaceToUserSpace._32));
+ Matrix::Translation(mDecoded.x, mDecoded.y));
target->FillRect(ToRect(available), pattern);
}
RefPtr<SourceSurface> newsurf = target->Snapshot();
return SurfaceWithFormat(new gfxSurfaceDrawable(newsurf, ThebesIntSize(size)), target->GetFormat());
}
// Not tiling, and we have a surface, so we can account for
--- a/image/test/reftest/gif/reftest.list
+++ b/image/test/reftest/gif/reftest.list
@@ -17,16 +17,19 @@
random == delaytest.html?transparent-animation.gif transparent-animation-finalframe.gif # incorrect timing dependence (bug 558678)
# 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
+# Bug 1068230
+== tile-transform.html tile-transform-ref.html
+
# 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
# webcam-simulacrum.mjpg^headers^, the web browser will get the following:
#
# HTTP 200 OK
# Content-Type: multipart/x-mixed-replace;boundary=BOUNDARYOMG
#
new file mode 100644
--- /dev/null
+++ b/image/test/reftest/gif/tile-transform-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1068230
+-->
+<html>
+<head>
+ <title>Intermediate surface should be transformed correctly when tiling an image</title>
+</head>
+<body>
+<button style="margin: 10px; padding: 10px; border: none; background: url('tiletest-ref.png');"></button>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/image/test/reftest/gif/tile-transform.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1068230
+-->
+<html>
+<head>
+ <title>Intermediate surface should be transformed correctly when tiling an image</title>
+</head>
+<body>
+<button style="margin: 10px; padding: 10px; border: none; background: url('tiletest.gif');"></button>
+</body>
+</html>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b493899cc87a4e872d18b27927b4e40eb630bab3
GIT binary patch
literal 282
zc%17D@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!5(0ceTp1WFIleOpd|;4x&Y<vs
zLE}1u!3743;|vb_89cT#_^)ROU%`;DfFWZ#Lw-L)MLR=%14DZ`Lw^Co^bCgi@eIo&
z7&Zhj>~Lo|;J|Rgg5iPz!*vaY`w9%t#Tnl7Gkj-fuz09)251*!NswPKgTu2MX+Tbf
zr;B4q#NoHs9GMy!7+5cQx(aEwbiJ$huD*TqUwIdMnBvCC8md~IQAzrR6Eal#gw`JM
zTr}CjJ4U6dbM+AgL$5n3?}Yd}Js)X)oK)d`MyUIU*2jrIymEwoI@V2)f5Hx>>g(jV
We=vT$$h87!CxfS}pUXO@geCxKJz+Zl
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7a04c9654a671361133f554050efda4b2c12ffc2
GIT binary patch
literal 156
zc${<hbhEHbWMoia_`<-z@tr~71B1kK289O<8rK;NE-+XeXK>ih;IW;-e?3F^3WkIQ
z3>niI^7|Po+8OE_7~0Dj`U@DQXE4l<XILJ=upxk9hdaXo2Zj?C3>OR-u4^#dS73N9
z&hVa};X6A65Gej+0Z|M(3=E7wD9^yaDybmA!5k>TK1qZ7vIW10r*LSb__R#v>y?TO
F)&TJcDXstj