Bug 958086 - Adjust matrix in gfxPattern::GetPattern for Moz2D. r=bas
authorAli Akhtarzada <ali@comoyo.com>
Fri, 10 Jan 2014 08:48:56 -0500
changeset 162944 5d5cee47612459b8164e7003fd6ce900eb110e92
parent 162943 f5e49d0f2e860181183e43c32df8b3cf89ea2686
child 162945 6ccb56d8984e12d38c440f0398c8fa7952283427
push id25975
push userryanvm@gmail.com
push dateFri, 10 Jan 2014 19:46:47 +0000
treeherderautoland@e89afc241513 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs958086
milestone29.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 958086 - Adjust matrix in gfxPattern::GetPattern for Moz2D. r=bas The pattern transform was not taking in to account the transform that was set on the draw target.
gfx/thebes/gfxPattern.cpp
--- a/gfx/thebes/gfxPattern.cpp
+++ b/gfx/thebes/gfxPattern.cpp
@@ -174,18 +174,21 @@ Pattern*
 gfxPattern::GetPattern(DrawTarget *aTarget, Matrix *aPatternTransform)
 {
   if (mGfxPattern) {
     mGfxPattern->~Pattern();
     mGfxPattern = nullptr;
   }
 
   if (!mPattern) {
+    Matrix adjustedMatrix = mTransform;
+    if (aPatternTransform)
+      AdjustTransformForPattern(adjustedMatrix, aTarget->GetTransform(), aPatternTransform);
     mGfxPattern = new (mSurfacePattern.addr())
-      SurfacePattern(mSourceSurface, ToExtendMode(mExtend), mTransform, mFilter);
+      SurfacePattern(mSourceSurface, ToExtendMode(mExtend), adjustedMatrix, mFilter);
     return mGfxPattern;
   }
 
   GraphicsExtend extend = (GraphicsExtend)cairo_pattern_get_extend(mPattern);
 
   switch (cairo_pattern_get_type(mPattern)) {
   case CAIRO_PATTERN_TYPE_SOLID:
     {