Bug 1137109 move the displaylist tracing inside nsViewManager::ProcessPendingUpdates, r=benwa, mattwoodrow
authorpchang <pchang@mozilla.com>
Thu, 26 Feb 2015 17:58:30 +0800
changeset 261877 d83e46943d92a5bcc3cc380159340079648b45d2
parent 261876 6f507d09cfec8692811f15cc87a070ea8c88ef5d
child 261878 e04b01edb94473ba82046177b4660166b5ef5bf5
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenwa, mattwoodrow
bugs1137109
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1137109 move the displaylist tracing inside nsViewManager::ProcessPendingUpdates, r=benwa, mattwoodrow
layout/base/nsRefreshDriver.cpp
view/nsViewManager.cpp
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -1691,17 +1691,16 @@ nsRefreshDriver::Tick(int64_t aNowEpoch,
     nsTArray<nsDocShell*> profilingDocShells;
     GetProfileTimelineSubDocShells(GetDocShell(mPresContext), profilingDocShells);
     for (uint32_t i = 0; i < profilingDocShells.Length(); i ++) {
       // For the sake of the profile timeline's simplicity, this is flagged as
       // paint even if it includes creating display lists
       profilingDocShells[i]->AddProfileTimelineMarker("Paint",
                                                       TRACING_INTERVAL_START);
     }
-    profiler_tracing("Paint", "DisplayList", TRACING_INTERVAL_START);
 #ifdef MOZ_DUMP_PAINTING
     if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
       printf_stderr("Starting ProcessPendingUpdates\n");
     }
 #endif
 
     mViewManagerFlushIsPending = false;
     nsRefPtr<nsViewManager> vm = mPresContext->GetPresShell()->GetViewManager();
@@ -1710,17 +1709,16 @@ nsRefreshDriver::Tick(int64_t aNowEpoch,
     if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
       printf_stderr("Ending ProcessPendingUpdates\n");
     }
 #endif
     for (uint32_t i = 0; i < profilingDocShells.Length(); i ++) {
       profilingDocShells[i]->AddProfileTimelineMarker("Paint",
                                                       TRACING_INTERVAL_END);
     }
-    profiler_tracing("Paint", "DisplayList", TRACING_INTERVAL_END);
 
     if (nsContentUtils::XPConnect()) {
       nsContentUtils::XPConnect()->NotifyDidPaint();
       nsJSContext::NotifyDidPaint();
     }
   }
 
   mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::REFRESH_DRIVER_TICK, mTickStart);
--- a/view/nsViewManager.cpp
+++ b/view/nsViewManager.cpp
@@ -370,26 +370,28 @@ nsViewManager::ProcessPendingUpdatesForV
     if (view) {
       view->ResetWidgetBounds(false, true);
     }
   }
   if (rootShell->GetViewManager() != this) {
     return; // 'this' might have been destroyed
   }
   if (aFlushDirtyRegion) {
+    profiler_tracing("Paint", "DisplayList", TRACING_INTERVAL_START);
     nsAutoScriptBlocker scriptBlocker;
     SetPainting(true);
     for (uint32_t i = 0; i < widgets.Length(); ++i) {
       nsIWidget* widget = widgets[i];
       nsView* view = nsView::GetViewFor(widget);
       if (view) {
         view->GetViewManager()->ProcessPendingUpdatesPaint(widget);
       }
     }
     SetPainting(false);
+    profiler_tracing("Paint", "DisplayList", TRACING_INTERVAL_END);
   }
 }
 
 void
 nsViewManager::ProcessPendingUpdatesRecurse(nsView* aView,
                                             nsTArray<nsCOMPtr<nsIWidget> >& aWidgets)
 {
   if (mPresShell && mPresShell->IsNeverPainting()) {