Backed out changeset 415f713d58b0 (bug 1239861) to fix perma-busted Android 4.3 debug R34
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 21 Jan 2016 16:47:31 +0100
changeset 303109 66e07ef46853709e3fa91e7c9ad9fe6abf0d5f06
parent 303108 977d78a8dd78afbc0153d37fd9887c3a200dce6a
child 303162 f36a4a4ff73f1184f569fd9152b98fe8d8d3866a
child 303219 b9b9318b8aefdf32c115f2e5e6514622388bb976
child 303242 ba6b0a9497ee2b557aee1138552074cd450609f8
push id8978
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 14:05:32 +0000
treeherdermozilla-aurora@b9a803752a2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1239861
milestone46.0a1
backs out415f713d58b0803cf143f0a605ed79409d57fc1d
Backed out changeset 415f713d58b0 (bug 1239861) to fix perma-busted Android 4.3 debug R34
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/ipc/CompositorParent.h
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -398,17 +398,17 @@ CompositorVsyncScheduler::Destroy()
 void
 CompositorVsyncScheduler::PostCompositeTask(TimeStamp aCompositeTimestamp)
 {
   // can be called from the compositor or vsync thread
   MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
   if (mCurrentCompositeTask == nullptr) {
     mCurrentCompositeTask = NewRunnableMethod(this,
                                               &CompositorVsyncScheduler::Composite,
-                                              aCompositeTimestamp, nullptr, nullptr);
+                                              aCompositeTimestamp);
     ScheduleTask(mCurrentCompositeTask, 0);
   }
 }
 
 void
 CompositorVsyncScheduler::ScheduleComposition()
 {
   MOZ_ASSERT(CompositorParent::IsInCompositorThread());
@@ -495,38 +495,31 @@ CompositorVsyncScheduler::CancelCurrentC
   MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
   if (mCurrentCompositeTask) {
     mCurrentCompositeTask->Cancel();
     mCurrentCompositeTask = nullptr;
   }
 }
 
 void
-CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp, gfx::DrawTarget* aTarget, const IntRect* aRect)
+CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
 {
   MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   {
     MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
     mCurrentCompositeTask = nullptr;
   }
 
-  if (aVsyncTimestamp < mLastCompose) {
-    // We can sometimes get vsync timestamps that are in the past
-    // compared to the last compose with force composites.
-    // In those cases, normalize to now.
-    aVsyncTimestamp = TimeStamp::Now();
-  }
-
   DispatchTouchEvents(aVsyncTimestamp);
   DispatchVREvents(aVsyncTimestamp);
 
   if (mNeedsComposite || mAsapScheduling) {
     mNeedsComposite = 0;
     mLastCompose = aVsyncTimestamp;
-    ComposeToTarget(aTarget, aRect);
+    ComposeToTarget(nullptr);
     mVsyncNotificationsSkipped = 0;
 
     TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
     mozilla::Telemetry::Accumulate(mozilla::Telemetry::COMPOSITE_FRAME_ROUNDTRIP_TIME,
                                    compositeFrameTotal.ToMilliseconds());
   } else if (mVsyncNotificationsSkipped++ > gfxPrefs::CompositorUnobserveCount()) {
     UnobserveVsync();
   }
@@ -547,20 +540,19 @@ CompositorVsyncScheduler::OnForceCompose
    */
   MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   mVsyncNotificationsSkipped = 0;
 }
 
 void
 CompositorVsyncScheduler::ForceComposeToTarget(gfx::DrawTarget* aTarget, const IntRect* aRect)
 {
-  MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   OnForceComposeToTarget();
-  SetNeedsComposite();
-  Composite(TimeStamp::Now(), aTarget, aRect);
+  mLastCompose = TimeStamp::Now();
+  ComposeToTarget(aTarget, aRect);
 }
 
 bool
 CompositorVsyncScheduler::NeedsComposite()
 {
   MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   return mNeedsComposite;
 }
@@ -635,19 +627,18 @@ CompositorVsyncScheduler::ScheduleTask(C
   MOZ_ASSERT(CompositorParent::CompositorLoop());
   MOZ_ASSERT(aTime >= 0);
   CompositorParent::CompositorLoop()->PostDelayedTask(FROM_HERE, aTask, aTime);
 }
 
 void
 CompositorVsyncScheduler::ResumeComposition()
 {
-  MOZ_ASSERT(CompositorParent::IsInCompositorThread());
-  SetNeedsComposite();
-  Composite(TimeStamp::Now());
+  mLastCompose = TimeStamp::Now();
+  ComposeToTarget(nullptr);
 }
 
 void
 CompositorVsyncScheduler::ComposeToTarget(gfx::DrawTarget* aTarget, const IntRect* aRect)
 {
   MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   MOZ_ASSERT(mCompositorParent);
   mCompositorParent->CompositeToTarget(aTarget, aRect);
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -121,19 +121,17 @@ public:
   void ScheduleTask(CancelableTask*, int);
   void ResumeComposition();
   void ComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr);
   void PostCompositeTask(TimeStamp aCompositeTimestamp);
   void Destroy();
   void ScheduleComposition();
   void CancelCurrentCompositeTask();
   bool NeedsComposite();
-  void Composite(TimeStamp aVsyncTimestamp,
-                 gfx::DrawTarget* aTarget = nullptr,
-                 const gfx::IntRect* aRect = nullptr);
+  void Composite(TimeStamp aVsyncTimestamp);
   void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect);
 
   const TimeStamp& GetLastComposeTime()
   {
     return mLastCompose;
   }
 
 #ifdef COMPOSITOR_PERFORMANCE_WARNING