Bug 1255705 - Generalize the NotifyLayersUpdated short-circuit codepath to trigger on empty transactions as well. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 11 Mar 2016 17:42:50 -0500
changeset 339707 f0802b8a086397685ede5cfddaa8668b241732a0
parent 339706 20c27df0407cbf537af2469f7ec0ef13741667c3
child 339708 4123969ee94c0ab32f831d39d44543fcd983c3c8
push id12803
push userjbeich@FreeBSD.org
push dateSun, 13 Mar 2016 09:48:54 +0000
reviewersbotond
bugs1255705
milestone48.0a1
Bug 1255705 - Generalize the NotifyLayersUpdated short-circuit codepath to trigger on empty transactions as well. r=botond MozReview-Commit-ID: KfNjyAIdtE1
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -3253,23 +3253,22 @@ void AsyncPanZoomController::NotifyLayer
                                                  bool aIsFirstPaint,
                                                  bool aThisLayerTreeUpdated)
 {
   APZThreadUtils::AssertOnCompositorThread();
 
   ReentrantMonitorAutoEnter lock(mMonitor);
   bool isDefault = mFrameMetrics.IsDefault();
 
-  if (!aThisLayerTreeUpdated && !isDefault) {
+  if ((aLayerMetrics == mLastContentPaintMetrics) && !isDefault) {
     // No new information here, skip it. Note that this is not just an
     // optimization; it's correctness too. In the case where we get one of these
     // stale aLayerMetrics *after* a call to NotifyScrollUpdated, processing the
     // stale aLayerMetrics would clobber the more up-to-date information from
     // NotifyScrollUpdated.
-    MOZ_ASSERT(aLayerMetrics == mLastContentPaintMetrics);
     APZC_LOG("%p NotifyLayersUpdated short-circuit\n", this);
     return;
   }
   mLastContentPaintMetrics = aLayerMetrics;
 
   mFrameMetrics.SetScrollParentId(aLayerMetrics.GetScrollParentId());
   APZC_LOG_FM(aLayerMetrics, "%p got a NotifyLayersUpdated with aIsFirstPaint=%d, aThisLayerTreeUpdated=%d",
     this, aIsFirstPaint, aThisLayerTreeUpdated);