Back out changeset 60b7888a323b (bug 947753 / bug 1122526) for Mac OS X mochitest-4 failure.
authorL. David Baron <dbaron@dbaron.org>
Thu, 16 Apr 2015 20:19:03 -0700
changeset 239695 1a51b749299f4528524fb259e479d456b309889f
parent 239694 a8cfb09ecc21dd10ccaa117b7f9ee216d2504b12
child 239696 fd1a9a382e7bba119a07869ea392a816f574cae8
push id12444
push userryanvm@gmail.com
push dateFri, 17 Apr 2015 20:04:42 +0000
treeherderfx-team@560a202db924 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs947753, 1122526
milestone40.0a1
backs out60b7888a323b7ffc3004e2ab4a2e3bd926252748
Back out changeset 60b7888a323b (bug 947753 / bug 1122526) for Mac OS X mochitest-4 failure. The failure was: TEST-UNEXPECTED-FAIL | gfx/tests/mochitest/test_acceleration.html | Acceleration enabled on x86-64 OS X - didn't expect 0, but got it I'm guessing this is because we're calling GetLayerManager earlier than we were before. CLOSED TREE
layout/style/AnimationCommon.cpp
--- a/layout/style/AnimationCommon.cpp
+++ b/layout/style/AnimationCommon.cpp
@@ -506,16 +506,25 @@ AnimValuesStyleRule::List(FILE* out, int
 
 bool
 AnimationPlayerCollection::CanAnimatePropertyOnCompositor(
   const dom::Element *aElement,
   nsCSSProperty aProperty,
   CanAnimateFlags aFlags)
 {
   bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
+  if (!gfxPlatform::OffMainThreadCompositingEnabled()) {
+    if (shouldLog) {
+      nsCString message;
+      message.AppendLiteral("Performance warning: Compositor disabled");
+      LogAsyncAnimationFailure(message);
+    }
+    return false;
+  }
+
   nsIFrame* frame = nsLayoutUtils::GetStyleFrame(aElement);
   if (IsGeometricProperty(aProperty)) {
     if (shouldLog) {
       nsCString message;
       message.AppendLiteral("Performance warning: Async animation of geometric property '");
       message.Append(nsCSSProps::GetStringValue(aProperty));
       message.AppendLiteral("' is disabled");
       LogAsyncAnimationFailure(message, aElement);
@@ -573,29 +582,16 @@ bool
 AnimationPlayerCollection::CanPerformOnCompositorThread(
   CanAnimateFlags aFlags) const
 {
   nsIFrame* frame = nsLayoutUtils::GetStyleFrame(mElement);
   if (!frame) {
     return false;
   }
 
-  nsIWidget* widget = frame->GetNearestWidget();
-  if (!widget ||
-      widget->GetLayerManager()->GetBackendType() !=
-        layers::LayersBackend::LAYERS_CLIENT) {
-    // No widget (huh?), or a widget not using off-main-thread compositor.
-    if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
-      nsCString message;
-      message.AppendLiteral("Performance warning: Compositor disabled");
-      LogAsyncAnimationFailure(message);
-    }
-    return false;
-  }
-
   if (mElementProperty != nsGkAtoms::transitionsProperty &&
       mElementProperty != nsGkAtoms::animationsProperty) {
     if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
       nsCString message;
       message.AppendLiteral("Gecko bug: Async animation of pseudoelements"
                             " not supported.  See bug 771367 (");
       message.Append(nsAtomCString(mElementProperty));
       message.Append(")");