Bug 811919. Include the pattern transform when painting patterns in DrawTargetCG. r=benwa
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 14 Nov 2012 16:52:02 -0800
changeset 113317 f9303bafc623cd4bf7207ea5a41a13b6b0105f98
parent 113316 c62f85640fc362de486ee3776d485cae8a6d4e9c
child 113318 bcb83b74c287576182add500193173b6ef1a038b
push id23869
push useremorley@mozilla.com
push dateThu, 15 Nov 2012 16:18:16 +0000
treeherdermozilla-central@a37525d304d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenwa
bugs811919
milestone19.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 811919. Include the pattern transform when painting patterns in DrawTargetCG. r=benwa This fixes a lot of azure content bugs.
gfx/2d/DrawTargetCG.cpp
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -404,17 +404,21 @@ CreateCGPattern(const Pattern &aPattern,
 
   //XXX: We should be using CGContextDrawTiledImage when we can. Even though it
   // creates a pattern, it seems to go down a faster path than using a delegate
   // like we do below
   CGRect bounds = {
     {0, 0,},
     {static_cast<CGFloat>(CGImageGetWidth(image)), static_cast<CGFloat>(CGImageGetHeight(image))}
   };
-  CGAffineTransform transform = CGAffineTransformConcat(CGAffineTransformMakeScale(1, -1), aUserSpace);
+  CGAffineTransform transform =
+      CGAffineTransformConcat(CGAffineTransformConcat(CGAffineTransformMakeScale(1,
+                                                                                 -1),
+                                                      GfxMatrixToCGAffineTransform(pat.mMatrix)),
+                              aUserSpace);
   transform = CGAffineTransformTranslate(transform, 0, -static_cast<float>(CGImageGetHeight(image)));
   return CGPatternCreate(CGImageRetain(image), bounds, transform, xStep, yStep, kCGPatternTilingConstantSpacing,
                          true, &patternCallbacks);
 }
 
 static void
 SetFillFromPattern(CGContextRef cg, CGColorSpaceRef aColorSpace, const Pattern &aPattern)
 {