Bug 746588 - Invert the gfxPattern matrix when using DrawTargets. r=jrmuizel a=akeybl
authorBas Schouten <bschouten@mozilla.com>
Mon, 23 Apr 2012 13:30:46 -0400
changeset 92138 d400d7f9eadda3fcf12fc9a83bd95d8c8693fd5b
parent 92137 3a0a2fbe7b47a4abbab050cd64bad842d2d669f0
child 92139 e8826e002d6993541b4ea6fee046b627c15adfb9
push id22516
push usereakhgari@mozilla.com
push dateMon, 23 Apr 2012 22:53:29 +0000
treeherdermozilla-central@8acbbeca4f42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, akeybl
bugs746588
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 746588 - Invert the gfxPattern matrix when using DrawTargets. r=jrmuizel a=akeybl
gfx/thebes/gfxPattern.cpp
--- a/gfx/thebes/gfxPattern.cpp
+++ b/gfx/thebes/gfxPattern.cpp
@@ -127,16 +127,20 @@ gfxPattern::AddColorStop(gfxFloat offset
 void
 gfxPattern::SetMatrix(const gfxMatrix& matrix)
 {
   if (mPattern) {
     cairo_matrix_t mat = *reinterpret_cast<const cairo_matrix_t*>(&matrix);
     cairo_pattern_set_matrix(mPattern, &mat);
   } else {
     mTransform = ToMatrix(matrix);
+    // Cairo-pattern matrices specify the conversion from DrawTarget to pattern
+    // space. Azure pattern matrices specify the conversion from pattern to
+    // DrawTarget space.
+    mTransform.Invert();
   }
 }
 
 gfxMatrix
 gfxPattern::GetMatrix() const
 {
   if (mPattern) {
     cairo_matrix_t mat;