Bug 1107843. When computing the transform matrix for a preserve-3d child just include the final translation right away, instead of doing two translations that add and subtract to increase the accuracy. r=mattwoodrow
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 01 Feb 2015 17:12:14 -0600
changeset 240401 f239e122ce45410daedd4bb91cbe9680839cc9e7
parent 240400 bcefc7d8d8859469897c4c66b48c5b4ef6e9afeb
child 240402 877c67c8ced41bbd1eb883442e07bc2d36004a28
push id535
push usercmanchester@mozilla.com
push dateMon, 02 Feb 2015 19:04:18 +0000
reviewersmattwoodrow
bugs1107843
milestone38.0a1
Bug 1107843. When computing the transform matrix for a preserve-3d child just include the final translation right away, instead of doing two translations that add and subtract to increase the accuracy. r=mattwoodrow
layout/base/nsDisplayList.cpp
layout/reftests/bugs/reftest.list
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -5202,21 +5202,23 @@ nsDisplayTransform::GetResultingTransfor
     // parent transform however *is* the reference frame, so we pass true for
     // aOffsetByOrigin to convert into the correct coordinate space.
     gfx3DMatrix parent =
       GetResultingTransformMatrixInternal(props,
                                           aOrigin - frame->GetPosition(),
                                           aAppUnitsPerPixel, nullptr,
                                           aOutAncestor, !frame->IsTransformed());
 
-    result.ChangeBasis(offsetBetweenOrigins);
+    if (aOffsetByOrigin) {
+      result.Translate(-aProperties.mToTransformOrigin);
+      result.TranslatePost(offsetBetweenOrigins);
+    } else {
+      result.ChangeBasis(offsetBetweenOrigins);
+    }
     result = result * parent;
-    if (aOffsetByOrigin) {
-      result.Translate(roundedOrigin);
-    }
     return result;
   }
 
   if (aOffsetByOrigin) {
     // We can fold the final translation by roundedOrigin into the first matrix
     // basis change translation. This is more stable against variation due to
     // insufficient floating point precision than reversing the translation
     // afterwards.
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1843,17 +1843,17 @@ test-pref(layout.css.grid.enabled,true) 
 == 1059498-3.html 1059498-1-ref.html
 == 1062108-1.html 1062108-1-ref.html
 fails-if(Android) == 1062792-1.html 1062792-1-ref.html
 == 1062963-floatmanager-reflow.html 1062963-floatmanager-reflow-ref.html
 test-pref(dom.webcomponents.enabled,true) == 1066554-1.html 1066554-1-ref.html
 == 1069716-1.html 1069716-1-ref.html
 == 1078262-1.html about:blank
 test-pref(layout.testing.overlay-scrollbars.always-visible,false) == 1081072-1.html 1081072-1-ref.html
-fuzzy-if(winWidget&&!layersGPUAccelerated,1,31) fuzzy-if(B2G,128,75) == 1081185-1.html 1081185-1-ref.html   # fuzzy with event-regions, see bug 1107843
+fuzzy-if(B2G,128,75) == 1081185-1.html 1081185-1-ref.html   # fuzzy with event-regions, see bug 1107843
 == 1097437-1.html 1097437-1-ref.html
 == 1103258-1.html 1103258-1-ref.html # assertion crash test with layers culling test
 == 1105137-1.html 1105137-1-ref.html
 fuzzy-if(d2d,36,304) HTTP(..) == 1116480-1-fakeitalic-overflow.html 1116480-1-fakeitalic-overflow-ref.html
 == 1111753-1.html about:blank
 == 1119117-1a.html 1119117-1-ref.html
 == 1119117-1b.html 1119117-1-ref.html
 == 1120431-1.html 1120431-1-ref.html