Bug 778367 - Part 2: Mark a test fuzzy where DWrite seems to render differently to a smaller surface. r=jrmuizel
☠☠ backed out by 377cda004bd7 ☠ ☠
authorBas Schouten <bschouten@mozilla.com>
Tue, 02 Oct 2012 00:00:15 +0200
changeset 108941 024f0c7ca3fcc0f6b842fd4e47f8f77cfed20ccd
parent 108940 9f856ef0f07892dd19686fac622665b3548c6cd8
child 108942 5065be124c8d8cac8004de6028d35739f603dff1
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersjrmuizel
bugs778367
milestone18.0a1
Bug 778367 - Part 2: Mark a test fuzzy where DWrite seems to render differently to a smaller surface. r=jrmuizel
gfx/thebes/gfxContext.cpp
layout/reftests/scrolling/reftest.list
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -1535,21 +1535,27 @@ gfxContext::PushGroupAndCopyBackground(g
     if (mDT->GetFormat() != FORMAT_B8G8R8X8) {
       gfxRect clipRect = GetRoundOutDeviceClipExtents(this);
       clipExtents = IntRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
     }
     if (mDT->GetFormat() == FORMAT_B8G8R8X8 ||
         mDT->GetOpaqueRect().Contains(clipExtents)) {
       DrawTarget *oldDT = mDT;
       RefPtr<SourceSurface> source = mDT->Snapshot();
+      Point oldDeviceOffset = CurrentState().deviceOffset;
       PushGroup(content);
+
+      Point offset = CurrentState().deviceOffset - oldDeviceOffset;
       Rect surfRect(0, 0, Float(mDT->GetSize().width), Float(mDT->GetSize().height));
+      Rect sourceRect = surfRect;
+      sourceRect.x += offset.x;
+      sourceRect.y += offset.y;
       Matrix oldTransform = mDT->GetTransform();
-      mDT->SetTransform(GetDeviceTransform());
-      mDT->DrawSurface(source, surfRect, surfRect); 
+      mDT->SetTransform(Matrix());
+      mDT->DrawSurface(source, surfRect, sourceRect); 
       mDT->SetTransform(oldTransform);
       mDT->SetOpaqueRect(oldDT->GetOpaqueRect());
       return;
     }
   }
   PushGroup(content);
 }
 
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,17 +1,17 @@
 HTTP == fixed-1.html fixed-1.html?ref
 random-if(bug685516) HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
 random-if(bug685516) HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
 random-if(bug685516) HTTP == fixed-text-1.html fixed-text-1.html?ref
 random-if(bug685516) HTTP == fixed-text-2.html fixed-text-2.html?ref
 random-if(Android&&!browserIsRemote) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
 random-if(Android) HTTP == image-1.html image-1.html?ref
 random-if(Android&&!browserIsRemote) HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref # bug 760269
-random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357
+fuzzy-if(d2d,10,606) random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357 - DWrite renders this subtly different on different size surfaces
 random-if(bug685516) HTTP == simple-1.html simple-1.html?ref
 HTTP == subpixel-1.html#d subpixel-1-ref.html#d
 HTTP == text-1.html text-1.html?ref
 HTTP == text-2.html?up text-2.html?ref
 HTTP == transformed-1.html transformed-1.html?ref
 HTTP == transformed-1.html?up transformed-1.html?ref
 == uncovering-1.html uncovering-1-ref.html
 == uncovering-2.html uncovering-2-ref.html